#stricks-clone-customers
1 messages · Page 1 of 1 (latest)
step 3 Creating charges
The error happens when I change the code example from
customer = Stripe::Customer.create({
** source: token.id,**
}, {
stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
})
to
customer = Stripe::Customer.create({
payment_method: token.id,
}, {
stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
})
I believe I got something wrong. the token got created with no issue, but after that I got stuck
Hmmmm, that error confuses me a bit. Can you get the request ID for the request that produced the error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
sure, the ID is here req_0f4YDxitbDjTRg
Checking with someone internally. Will get back to you once I have an update
Thanks, I found a workaround but not sure if it's the correct way of doing it, so will be better to have a correct way of doing it
I think it would be better not to create tokens at all, and instead to create Payment Methods. The docs you found are legacy, so I would recommend replacing steps 1 and 2 with creating a Customer and creating/attaching a Payment Method, instead of Creating a Token
but how can I clone the payment method? I already have one on my account, but I want to charge on a connected account
In step 3, you should be able to just pass payment_method instead of source when you create the customer on the new account.
is it ok to create a customer with the token, and on the paymentntent.create use the token.id for the customer and the token.default_source to the payment_method?
I wouldn't do that. If you don't already have a ton of tokens created, I wouldn't build anything that starts creating them. This is a legacy process and it is only going to make it harder for you to debug and get answers
ok can you share with me an example of doing it the right way?
Steps:
- Create customer on platform account
- Create Payment Method
- Attach Payment Method to Customer
- Clone Payment Method as mentioned here: https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
- Create charges (profit)