#emrys_subscription-defaultpm
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/1286356114216194099
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
emrys_subscription-defaultpm
@hot root you missed something important. It's not your fault, everyone misses it, and if you ask me it should have been the default behaviour years ago ๐
But basically when you create the Subscription you need to configure it so that the PaymentMethod you collect for the first Invoice is then automatically marked as the default PaymentMethod for future payments on that Subscription. You want this parameter: https://docs.stripe.com/api/subscriptions/create#create_subscription-payment_settings-save_default_payment_method
Alternatively, after the payment is done, you can call the Update Customer API https://docs.stripe.com/api/customers/update in your own code and set the PaymentMethod pm_1234 as the default globally on the Customer for all future Invoices and Subscriptions by setting the invoice_settings[default_payment_method] parameter: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
thanks for the quick response!
so payment_settings.save_default_payment_method = 'on_subscription'
that makes perfect sense!! thanks
sure thing!