#Wasabi-default-payment
1 messages · Page 1 of 1 (latest)
Yes, subscriptions will use their default payment method or the customer's default payment method if you set that setting
Thanks @lucid patio . To confirm, a SetupIntent is not required to continue to charge a customer when updating a payment on a subscription as described above?
Create a new payment method with POST 'https://api.stripe.com/v1/payment_methods'
Attach the payment method to the customer with POST 'https://api.stripe.com/v1/payment_methods/pm_1JxDtKJyGVgKQ3vzsnTnxMGy/attach'
Update the invoice_settings[default_payment_method] on the customer with POST 'https://api.stripe.com/v1/customers/cus_KTpR0hNAWmQGpw'
Update the default_payment_method on the subscription with POST 'https://api.stripe.com/v1/subscriptions/sub_1Jorn9JyGVgKQ3vz2pvFoOzZ'
I want to account for the scenario where a customer who has an active subscription wants to change the credit card on their subscription so that the next time they are billed (X months from now), their new credit card will be charged.
In steps #1-4 in the question, I am trying to create a brand new payment method (not update an existing one) and set it as the default payment method on both the customer and subscription object. Is this a valid approach for changing the credit card on subscription so that when it’s time to renew the subscription, the user is billed with the new payment method instead of the original one?
I think that should work. And how are you collecting the details and making the call to create the PaymentMethod in step one?
I think the current plan is to create card token, create customer, create paymentIntent, create subscription - this for the new subscription
Do you see any issues with step 1-4 above given how the new sub will be created?
catching up here one sec
thank you @cold chasm
@agile nacelle why do you create a PaymentIntent? when you already create a Subscription?
To collect a payment?
yeah but the Subscription does that for you too
like so far you're talking about Subscription so why would you manually create a one time payment via a PaymentIntent
So is the steps above correct to update a payment method without having to use SetupIntent?
these steps ^
Hello! If you want to update the Payment Method for a Customer with an existing Subscription you should use a Setup Intent to set up the new Payment Method for future use and attach it to the Customer, then set that new Payment Method as the Customer's invoice_settings.default_payment_method so it's used for future Invoices by default.
I totally agreed with you. Are the steps above not valid to update a sub payment?
Attach the payment method to the customer with POST
You should not do this. You should use the Setup Intent to attach the Payment Method to the Customer: https://stripe.com/docs/api/setup_intents/create#create_setup_intent-customer
Update the default_payment_method on the subscription with POST
You can do this if you wish, but it may be redundant if you're also using invoice_settings.default_payment_method on the Customer as well.
@dapper pagoda I want to recommend SetupIntent. Can you help me understand the tradeoffs if going with the payment method route? Why should user not use PaymentMethod to update subscription payment?
yes should be either subscription default_payment_method or the customer invoice_settings.default_payment_method.
Please excuse me from jumping in to help, for the PaymentMethod route, the difference is the extra API call you would need to call.