#littleape - PHP Stripe.js
1 messages ยท Page 1 of 1 (latest)
Hello
I'm sorry that sounds rather complicated. Can you describe, from your users point of view, what you would like to happen?
Ok this is for a service where they will get charged monthly. They sign up, and we setup billing using SetupIntent and collect the cc info using Stripe.js Elements. All good. Now at some point in the future the client wants to use a different cc for future billing. Stripe.js doesn't appear to have the ability to do this. It seems I have to start the billing setup process from the begining and create a new SetupIntent and have Stripe.js collect new cc info. The old SetupIntent still exists in the Stripe system, seems messy to just leave it there.
- You don't re-use Setup Intents. That's not how they function.
- You can update default Payment Methods simply by using a new Setup Intent for the same Customer
So its normal to leave the original SetupInent out there, it won't cause any issues?
Should I detach the payment method from the original SetupIntent before abandoning it for a new one? Or is it fine just to leave it and create a new SetupIntent
I'm just used to cleaning up things so this is a little unusual to me ๐
- don't detach the payment method from the Setup Intent, detach it from the Customer.
https://stripe.com/docs/api/payment_methods/detach
- The Setup Intent record should be left as a record of what you did previously. With financials it's good to have records for everything you do
Oh ok, I guess I was doing that just had the wording wrong. I was detaching from the customer. Ok thank you.
Okay yeah, so the Setup Intent record exists as a record of what you first did. You can also just overwrite which Payment Method is the default for the Customer without removing it.
You would update the default_payment_method in the invoice_settings property: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Perfect thank you.