#stricks-clone-customers

1 messages · Page 1 of 1 (latest)

naive radish
#

What step in that guide specifically are you stuck on?

long vapor
#

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

naive radish
#

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

long vapor
#

sure, the ID is here req_0f4YDxitbDjTRg

naive radish
#

Checking with someone internally. Will get back to you once I have an update

long vapor
#

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

naive radish
#

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

long vapor
#

but how can I clone the payment method? I already have one on my account, but I want to charge on a connected account

naive radish
#

In step 3, you should be able to just pass payment_method instead of source when you create the customer on the new account.

long vapor
#

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?

naive radish
#

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

long vapor
#

ok can you share with me an example of doing it the right way?

naive radish