#Priyanka
1 messages ยท Page 1 of 1 (latest)
hi! you need to pass the Stripe-Account header on all API requests creating/updating/retrieving objects on the connected account. https://stripe.com/docs/connect/authentication
I am passing this
var requestOptions = new RequestOptions
{
StripeAccount = "{{CONNECTED_ACCOUNT_ID}}",
};
When I try to create payment intent
with connected account's id
then the Customer ID you're passing must be incorrect, for example you are passing the ID of a Customer created on the platform account, not one created on the Connected account.
note if you are cloning PaymentMethods, it's only the PaymentMethod that is cloned, nothing else. Unless you explicitly create one, there is no Customer on the connected account involved.
So does that mean I need to clone the customer as well?
to connected account
because my customer exists only on platform account and not on connected account
you don't have to, it depends on your use case. If you want to create a Customer on the connected account so you can attach the cloned payment method to that customer(and use it more than once), you can; otherwise you can just pass the PaymentMethod directly to a PaymentIntent and charge it.
Actually I don't want to create or clone customer to connected account.
I have succesfully cloned payment method from platform account to connected account
Now should I use that cloned payment method to create a payment intent using platform account?
you mean "using the connected account", right?
I used connected account first and then it gave me this error:- No such customer
yep
and as we've been discussing, you don't have a Customer on the connected account
yes
and you say you don't want one
so
remove the customer param from the API call you're making ๐
OK let me try that one ๐
OK it worked and payment got created on connected account. ๐
But then how can I add customer information like (stripe customer id from platform account) to this payment that got created.
Metadata maybe?
you can use metadata yes
Ok thanks a lot. And can you give me information on how can I use this cloned payment method id in future for future payments?
you'd have to create a Customer on the connected account and attach the PaymentMethod to that customer.
or how about I clone the payment method id every time when I want to create a payment intent on connected account?
Does that sound ridiculous? ๐
that's normal and is usually what I suggest.
otherwise you'd have 100 different Customer accounts all with slightly different saved cards and if the actual user wants to update their details you have to go re-clone a card to all 100 connected accounts, etc.
how long does these cloned payment method id stay on connected account? I mean what's their lifetime and will I be creating lot of cloned payment methods unnecessarily every time?
they stay forever
Then I am just worried it will create lot of ids ๐
how about attaching this newly cloned payment method id to customer on platform account?
is that possible?
the IDs don't matter
that's impossible
Maybe I can save it somewhere, like some database and reuse it ๐
what do you think?
Is that the best approach?
you can't re-use an pm_xxx ID that is charged once , that consumes it.
what it comes down to is
-
option 1 : Customer on the platform account. On-demand, clone a PaymentMethod to the connected account, create a PI and charge it. You're done, that's it. Clone again the next time you want to charge and create a new pm_xxx
-
option 2 : Customer on the platform account. Customer on the connected account. Clone the PaymentMethod to the connected account and attach to the Customer there. Process a PI using that
customerID and ID of the cloned PaymentMethod. That can be done multiple times. But then you end up with the "100 different Customer accounts all with slightly different saved cards and if the actual user wants to update their details you have to go re-clone a card to all 100 connected accounts, etc." which is why often it's easier to go with option 1 with the "master" customer.
Awsome. That's really a valuable piece of information which is not present on stripe documents. I will go with option no. 1 and clone it every time. ๐
Thank you so much for sharing all this. I think I got everything.
I wish you a wonderful day ahead ๐
yes the docs for cloning are extremely bad overall and the feature is not well-fleshed out or well documented unfortunately
Sorry one last question. ๐ What's the difference between 'card_xxx' and 'pm_xxx' in payment methods?
one is legacy and should not be created any more (card_xxx)
I'm aware the guide at https://stripe.com/docs/connect/cloning-customers-across-accounts still refers to such objects, that's part of why I say the docs are bad. The correct approach is https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods that uses the PaymentMethod pm_xxx APIs.
OK. Thank you so much ๐