#jerome_api
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/1225844374479573145
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
If I recall correctly, you'd see a customer.subscription.updated event when the customer updates the payment method for a subscription
https://docs.stripe.com/billing/subscriptions/webhooks#events
You can listen to that webhook event and handle the next actions accordinglyt
I'd recommend trying it out in test mode
I am not adding the customer's card manually in stripe. I need to handle it to nodejs API
So I need to update the customer card details through my backend api. Now my question is how can the card details get updates in subscription too?
It depends on how the subscription was created.
If a default_payment_method was set on the subscription itself on creation, then you can set the new payment method by updating subscription.default_payment_method parameter
https://docs.stripe.com/api/subscriptions/update
If the subscription was created without a default payment method (which means it charges customer's default_payment_method instead) then you can update customer.invoice_settings.default_payment_method parameter
https://docs.stripe.com/api/customers/update