#piyush_unexpected
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/1417228271728328876
đ 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.
- piyush_api, 4 days ago, 10 messages
- piyush_code, 4 days ago, 4 messages
- piyush_best-practices, 4 days ago, 14 messages
- piyush_best-practices, 4 days ago, 8 messages
Hello
Are you setting the saved payment method to customer.invoice_settings.default_payment_method after the SetupIntent is successful?
If not, that might explain why
no, and thanks.
should i be doing it in webhook, or after successfully set up intent, by calling any backend api(it will attach the pm_id to the customer's default invoice pay method by calling stripe api), what's the best practice?
It's totally upto you and how you handle this
can i get payment_method_id somehow at client side after successfully setting up the payment method through set up intent?
Yes, see - https://docs.stripe.com/payments/save-and-reuse#submit-payment-details
You can use stripe.retrieveSetupIntent to retrieve the SetupIntent using the setup_intent_client_secret query parameter. Successful confirmation of the SetupIntent saves the resulting PaymentMethod ID (in result.setupIntent.payment_method) to the provided Customer.
there's an example under Step 6