#kaustuva-le-cloning
1 messages · Page 1 of 1 (latest)
@devout sentinel sounds like you're missing passing the Stripe-Account header to call , which is required. You use your platform's API key and that header set to the ID of the connected account.
I'm passing the account id of the connected account as well in the call for token creation
you probably are passing a variable for the account ID in your code and the variable is null
can you share the exact code you're using?
for what it's worth anyway, the docs are really bad for this feature unfortunately. You really shouldn't use tokens at all for this, you should use https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
Yes, turns out that the account id was being passed as null. Thanks.
I get a new error now...
'The customer must have an active payment source attached.'
Is this referring to the customer on the platform account?
I'd need to see the API request that gave you the error to know
can you post the request ID ? req_xxx https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_WBLTzYNqIjR4dQ
looking, sorry for the delay
yeah this is due to the horrible docs I alluded to basically
this fails because the customer doesn't have any payment methods
so there is nothing to clone
remember this feature is not actually cloning customers, that's not what it does(maybe the docs say that, but it's not what happens). All it is is, you have a Customer on the platform account with a saved card. You can copy that card to a connected account .Then you can create a new separate Customer on the connected account and attach the cloned card to it; it's a "building block" for a concept of shared/cloned customers
Okay. So I changed the code to first attach a source to the platform account before trying to create a token and then create the clone. I'm getting this error:
https://dashboard.stripe.com/test/logs/req_wMXk1e8Ibt0oAo
I wouldn't use Sources at all, they are deprecated
but looking at your account you have been around for a while and have some Stripe contacts so I guess you have a legacy integration you're working with, so fair enough!
I'm not familiar with that call you're making, but if you're using Source src_xxx objects(which you are as far as I can tell), you need to use https://stripe.com/docs/sources/connect#cloning-card-sources instead.
can I just do this?
- create customer on platform,
- attach source to it,
- clone source using above method,
- create a regular customer on connected account ( same way as step 1, with stripe connect account as passed as parameter)
- attach the cloned source to step 4
- create a charge on connect account
yep that's exactly what it is!
that is indeed what you do. The docs like https://stripe.com/docs/sources/connect#cloning-card-sources is what Step 3 there is.
Thanks a lot. Will try this