#xiaogangliu-cloning

1 messages · Page 1 of 1 (latest)

unborn sentinel
#

@silver stream as the error indicates you must be doing something wrong(like you're using the wrong API key or authentication), hard to say.
What's the exact code you've written and which call gives that error?

silver stream
#

i clone the payment method from another customer

unborn sentinel
#

from another customer
you mean, from a customer on your platform account right?

#

can you share what the value of ild is so I can understand better what you're doing?

silver stream
#

fId = 'req_hWbIXQjkXvruGt';
const fPKey = 'pk_test_51HPktwFYFYqYTqZyYHSNch7anG6s9BYWC589NVBafvzgv6V1VVNLS1ZUe2CW5MC2pkeCNUxB2mXs9vzSrMw13MMy00iA4IrxVB';
const fSKey = 'sk_test_51HPktwFYFYqYTqZyAr7Hpwmh4jMnWj5uwrXjPNQIAZExHKw8zQFCo03Z2QGEwHXDn4b0ZWSL2U0sNHbHLUGnUBVy00cQfZPVup';
iId = 'req_cLwPVRsyi86hVf';
const iPKey = 'pk_test_51HPkv0J5YgkW7Mz28vLVhS0eSy3Bo2vi0TJlUJl0SdLdDvp2jASp6tw2Ymbt2AfYAOespe0swZBO5Kjwaz3ufjSI00g06yjnOi';
const iSKey = 'sk_test_51HPkv0J5YgkW7Mz2BBpiVy0Oqh3EfufcCSf02RoYQUyUvJBsNnPADxIOap45LnVWvmdW71FW9BzkLrtbF9hGQHsH00cxS5lHLj';
fStripe = require('stripe')(fSKey);
iStripe = require('stripe')(iSKey);
const fPaymentMethod = await fStripe.paymentMethods.create({
type: 'card',
card: {
number: '4242424242424242',
exp_month: 9,
exp_year: 2022,
cvc: '314',
},
});
const fCustomer = await fStripe.customers.create({
payment_method: fPaymentMethod.id
});
const fPaymentIntent = await fStripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
payment_method_types: ['card'],
customer: fCustomer.id,
payment_method: fPaymentMethod.id
});
let res = await fStripe.paymentIntents.confirm(fPaymentIntent.id);
// expect(res.status).to.equal('succeeded');
const iPaymentMethod = await iStripe.paymentMethods.create({
customer: fCustomer.id,
payment_method: fPaymentMethod.id
},{
stripeAccount: iId
});

unborn sentinel
#

hmm why are you passing a req_xxx request ID 😅

#

that makes no sense unfortunately, I think you're quite lost.

#

you don't seem to be using Connect at all and I'm really not sure what you're trying to actually do. You can't create a customer on the "f" account and then just copy it to the "i" account by using a different API key, those two accounts are completely unrelated.

silver stream
#

i want to clone the customer of f account to i account,

#

for customers of f may be charged by i account

#

so I does not to make them type card number again

unborn sentinel
#

cool!

#

then you can do that but you have to be using Connect, where 'f' is the platform and 'i' is the connected account.

#

Right now you don't seem to be using Connect at all right? So you should start from the links I shared above to understand what the product is and how it works.

silver stream
#

thanks!

silver stream
#

hello, here is our demanding:
We have customer in UK, Norway and European countries,but our current account is European, so when we charge UK customers there is an extra fee for the rate exchange.
To reduce this unnecessary fee we want to charge UK customers by UK account and Norway customers by Norway account in their own country, meantime when UK customers travel to Europe
we want to charge them by European account not UK account.
Do you have some suggestions?

silver stream
#

@unborn sentinel

unborn sentinel
#

yep you can do that, you'd ask the customer where they're from(or look at card.country on the PaymentMethod object) and then you can clone the PaymentMethod to a local account and charge there. Assuming you have all the Stripe accounts and legal entities you need and have connected them using Connect

silver stream
#

I user connected account to charge, what the fee in the red box of the picture for?is for currency transfer or something else?

merry pollen
#

That is stripe processing fee

silver stream
#

thank you

merry pollen
#

np

silver stream
#

Is there any document describe the stripe processing fee?

#

@merry pollen

merry pollen
#

you can take a look at this

silver stream
#

thanks

silver stream
#

hello, I have a question, can I clone the user created in connected account to the platform account. How to do that? @unborn sentinel

merry pollen
#

no you cannot