#jerome_api

1 messages ¡ Page 1 of 1 (latest)

dawn spearBOT
#

👋 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.

upbeat remnantBOT
narrow valve
#

I'd recommend trying it out in test mode

lunar zealot
#

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?

narrow valve
#

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