I am trying to save a credit card during payment using stripe connect.
I am following the docs here
However, the docs are not for stripe connect. They are for regular stripe payments.
My code is the same as the docs except my paymentIntents is created on the connected account because I want the charge to be on the connected account.
stripe.paymentIntents.create({
payment_method_types: ['card'],
amount: Math.round(Number(req.body.stripeData.amount *100)),
currency: userEvent.currency,
description: userEvent.title,
application_fee_amount: Math.round(Number((fees.applicationFee) *100)),
customer: stripeCustomerID
},{
stripe_account: sellerDetails.stripeAccountID,
}
)
This is throwing me the error No such customer: 'cus_ITBFODvD6dB1vP'
which makes sense because the customer is set up on the platform account.
I want to save the customer and the payment method to my platform account and then charge on the connected account.
Is there a slick way I can do this similar to the docs or must I do a work around - code to save the customer and payment method on the platform account and then automatically charge it on the connected account