#gerarda-clone-payment-method
1 messages · Page 1 of 1 (latest)
You can follow this guide to clone payment_method from the platform https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
what errors are you seeing and can you share your code on cloning the payment_method?
yeah you don't want to create a Token at all
as I said yesterday the docs are very confusing unfortunately
just forget about Tokens entirely, they're legacy! Instead of https://stripe.com/docs/connect/cloning-customers-across-accounts#creating-tokens you'd use https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
Sorry, this whole area is poorly documented.
I have two connected accounts related to the platform account, I want to do two payments with these accounts with the same payment card details. So I create the stripe elements with the first connected account and mounts it stripe = Stripe(data.publicKey, {stripeAccount: "acct_1JClrVCz5n0FQ626"});
var elements = stripe.elements(); After that I create the first payment intent and confirm it, is it in succedded status
after that I create a Payment method client side:
var paymentMethod;
stripe.createPaymentMethod({
type: 'card',
card: card,
billing_details: {
name: 'Jenny Rosen',
},
}).then(function(result) {
paymentMethod = result.paymentMethod;
fetch("/clone-paymentMethod", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(paymentMethod)
})
});
I create a new customer with the second connected account id and I cloned payment method and I created a new payment intent
com.stripe.exception.InvalidRequestException: No such PaymentMethod: 'pm_1JadFbCz5n0FQ626dBwg3BRX'; code: resource_missing; request-id: req_FPWJhfvhb8pNkM
I have the same error
note you can't clone the payment method from one connected account to another
only from your platform down to a connected account. That's probably why you're getting an error
So I create the stripe elements with the first connected account and mounts it stripe = Stripe(data.publicKey, {stripeAccount: "acct_1JClrVCz5n0FQ626"});
that part is wrong since you're creating the PaymentMethod directly on that connected account, so you could never clone it elsewhere
ok but I cannot do a payment with the platform account
I should create only a payment method with platform account, after that should I create two payment methods, two customer and two payment intent it whit the connected accounts?
you don't have to! usually the way it works is you do like, on the frontend :
var stripePlatform = Stripe(data.publicKey);
var stripeConnectedAccount = Stripe(data.publicKey, {stripeAccount: "acct_1JClrVCz5n0FQ626"});
...
stripePlatform.createPaymentMethod(...)
...
// send PaymentMethod to the backend and clone it and create a PaymentIntent on the connected account
stripeConnectedAccount.confirmCardPayment(client_secret)
a payment method with platform account, after that should I create two payment methods, two customer and two payment intent it whit the connected accounts?
yes!
but really if you're doing multi-basket stuff like this it usually makes more sense to just do one payment on your platform and then transfer the money to the connected accounts https://stripe.com/docs/connect/charges-transfers
https://stripe.com/docs/connect/charges#separate-charges-transfers
the way you're doing this now will result in the customer's card getting charged twice in a couple of seconds by two separate merchants. The customer might have to do 3D Secure twice in a row. Their bank might decline the payments as looking like duplicates. It's messy.
yes I know, but the client won't do it for business issues
so I didn't transfer money
Hello @toxic aurora I tried to create a payment method with the platform account stripe.createPaymentMethod and I created a customer of connected account, passing the payment method from front end