#rubs-subscription
1 messages ยท Page 1 of 1 (latest)
After the successful payment, you can listen to invoice.payment_succeeded event then update the customer's invoice_settings.default_payment_method: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you
No problem ๐
open
Thanks
I would know what is the best way to retrieve the payment method used to attach it as default payment method
Because in the event invoice.payment_succeeded there is not payment_method id
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#default-payment-method describes exactly how to do it
(you look at the Invoice's PaymentIntent , the method is on that)