#gunwantkumar_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1306871869357686835
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- gunwantkumar_unexpected, 6 days ago, 6 messages
out of curiosity, why don't you just create the Customer before hand, and pass the Customer id in when creating the Checkout Session?
This way, when the payment is completed, the PaymentMethod (card) will automatically be attached to the Customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I know about this. In my case i want to show single page checkout so...
what does including a customer id got to do with single page checkout?
Without customer id i can't identify the charge.
yes, so why not include the customer id when you create the Checkout Session?
At that time, I don’t have the customer details. In my case, the customer enters their name, email, and card details on the same page and confirms the payment, so I need to manage everything on my end.
alright. You mentioned that its not working in my case, what isn't working? Are you running into an error?
this function not working in my case, i'm getting error.
await stripe.paymentMethods.attach(
payment_method_id,
{ customer: customer_id },
{ stripeAccount:account_id },
);
and
await stripe.customers.update(customer_id, data, { stripeAccount: account_id });
I'll share error details.
Its working when i passed setup_future_usage: 'off_session', but i remove this its not working
again, what's the error message?
The customer does not have a payment method with the ID pm_1QLJo4GHf1WlTIAfo3ZuHMy0. The payment method must be attached to the customer.
So yes, you need to include setup_future_usage: 'off_session' otherwise the payment method is not setup for future usage and cannot be attached to a customer.
If i include setup_future_usage: 'off_session' apple pay element doesn't show in stripe payment element.
That's expected behaviour right now and it's mentioned here - https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=stripe-hosted#payment-methods
We filter ApplePay if you set
setup_future_usage
We're disabling Apple Pay on Checkout Session with setup_future_usage until we can build support for creating Apple Pay Merchant Tokens with this flows
It that case how can i attach and set default payment method set to customer.
Please guid me.
can you share an example Checkout Session id or PaymentMethod id where you created Checkout Session with setup_future_usage?
with setup_future_usage, Its working fine.
without setup_future_usage its not working.
without setup_future_usage its not working.
Checkout Session id : cs_test_b1vGgxhpKCQxhINp17l38B6Tr1lWxRwpEF2rNPHCxfkIjhVwRUB9OWchgG
PaymentMethod id: pm_1QLJo4GHf1WlTIAfo3ZuHMy0
yes, so you always need to include setup_future_usage. To clarify, if you want to save (attach) the card to the customer, you will not see Apple Pay as a payment method option right now
you cannot use setup_future_usage, and display apple pay. Does that make sense?
yup, Thank you for being so helpful.
Do you still need help with setting the default payment method on the customer? Or that's not an issue right now after I've clarified how it works