#sanjeewa
1 messages · Page 1 of 1 (latest)
Hi there, can you share with me the link to the doc that you are following?
Ok, so you want to clone a payment_method from platform to a collected account?
Yes
OK. Are you having a legacy Stripe integration that use Sources and Tokens API, or you are building something new? I'm asking because Sources and Tokens are legacy APIs, and I'll suggest you using PaymentMethods API
Im building new thing
https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods Then you should use this doc instead
Thank you will check
We can implement this to do direct payment to connected account but when we view payment details it is not showing customer infomation
Did you specify a customer for this direct charge?
When I pass customer ID it occurred an error
"No such customer: 'cus_MvpSH2oiW60Z0I'"
It looks like you passed in a customer that was created in platform
You should create a new customer in connected account, and use this customer for direct charge
This can be get done by cloning the customer ?
No, you can't clone a customer
This is my code & followed this
Is there anything wrong with for direct charges ?
Also when we try this, we got a error
this is the request ID
Hmm. it looks like you are still using Tokens and Sources API?
Usually you need to collect a payment method from frontend by integrating Stripe.js. For simplicity, you can just use these test payment_method ID to test out Stripe APIs https://stripe.com/docs/testing?testing-method=payment-methods
So you mean we can clone a paymentmethod from platform to connected account using cusotmer_id & payment method ID as below
$payment_method = \Stripe\PaymentMethod::create([
'customer' => '{{CUSTOMER_ID}}',
'payment_method' => '{{PAYMENT_METHOD_ID}}',
], [
'stripe_account' => '{{CONNECTED_ACCOUNT_ID}}',
]);
But we cant clone the customer from platform to connected account ?
yes you are right