Reputation: 439
I'm trying to find the way for customers to reuse saved payment methods for any business within a platform.
I'm building a platform that allows customers pay directly to businesses via Stripe Connect. I want customers to be able to save payment methods prior to purchases and then reuse saved payment methods for any business.
As I understand, payment methods first have to be created at the platform's customer stripe account and then copied to connected business' customer stripe account at the time of the (first) purchase.
I would like to use the newer SetupIntents, PaymentMethods and PaymentIntents APIs, but haven't been able to figure out how to clone payment methods between platform and connected stripe accounts.
Any advice would be appreciated.
Upvotes: 8
Views: 3153
Reputation: 3240
You can clone a payment method that was created on a platform account onto a connected account by calling the PaymentMethods API with the connected account's ID, the PaymentMethod ID, and the ID of the Customer it's saved to. A full example in all the languages Stripe supports is available here:
https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
Note that this is only necessary for Direct Charges, and that you will need to clone the PaymentMethod each time you create a direct charge on behalf of a connected account. The only way around this would be to create a duplicate Customer on the connected account and save the cloned PaymentMethod onto it.
Upvotes: 6