#sarim_code

1 messages ¡ Page 1 of 1 (latest)

toxic bobcatBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1397927939273658501

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

river current
#

Hey there, the last example (payment method create) is the way to achieve this to clone to a connected account for direct charges.

#

Can you share an example of the erroring request(s) so that i can offer guidance?

vital flint
#

Request POST body
{
"customer": "cus_SjZdEMNSyqgDGc"
}

river current
#

Oh, dont make this call

#

Since you're now collecting payment methods, use the payment method create call you showed instead

vital flint
#

I am getting this error while cloning a customer here
$token = \Stripe\Token::create([
'customer' => $platForm_customer_id,
], [
'stripe_account' => $connected_account_id,
]);

#

let me explain the flow

river current
#
$payment_method = \Stripe\PaymentMethod::create([
  'customer' => $platForm_customer_id,,
  'payment_method' => $platForm_pm_id,
], [
  'stripe_account' => $connected_account_id,
]);

This piece you shared should do what you want

vital flint
#

so we don't need to clone the customer from now?

river current
vital flint
#

yes

river current
#

the "clone a customer" flow is a bit of a misnomer, the customer itself is never copied, only a new card copy is made, and you manage the customer yourself

vital flint
#

the is the complete example to clone customer
$token = \Stripe\Token::create([
'customer' => $platForm_customer_id,
], [
'stripe_account' => $connected_account_id,
]);

$customer = \Stripe\Customer::create([
'source' => $token->id,
], [
'stripe_account' => $connected_account_id,
]);

river current
#

Yea but you're not using tokens anymore

vital flint
#

yes. so the solution is we don't need to copy the customer jsut clone the payment method for connected account

#

remember we only collecting card info one time and charging the customer for connected accounted later on.

river current
#

If you want to track the payments and re-use the payment method on the connected account, you can optionally create a customer on the connected account and attach the cloned payment method, but this is not required

vital flint
#

your recommended flow?

river current
#

So you've already got the platform customer and creating+confirming setup intents for them:
Create SI: https://dashboard.stripe.com/logs/req_WSUNOux4PZDnGr
Confirm SI: https://dashboard.stripe.com/logs/req_p8yvH3chocIYPC

vital flint
#

yes

river current
#

After that succeeds, you then have a PM attached to the customer

vital flint
#

yes we are creating setup intent using customer id

river current
#

Do you want/need customer objects on the connected accounts, or not?

vital flint
#

we are just making payments for connected account other than that we are not using any where customer for connected account

river current
#

The flow can work with or without them, so whether you need them or not is purely based on your business purposes

#

Ok, so lets leave them out for now

river current
river current
#

the result will be a one-time-use PM on the connected account that you can use to create a payment intent

#

(you still have the re-usable PM on the platform customer that you can clone again later to the same or different connected accounts for future payments)

vital flint
#

got it but what if we need to how can clone customer for connected account. in this flow

river current
#

Like i said, there really isn't any way to clone a customer -- just cards (and bank accounts) from platform customers

#

Creating the connected account customer is done manually by you, when needed

vital flint
#

ok ok so we don't need it at all as we are already creating pm for connected account. Does setupIntent and confiming it on frontend will suport the 3D Secure / SCA: card authentication for future use?
I wasn't able to test it on beta in test mode

river current
#

It does set it up for future, but you still need to be prepared to handle future authentication when banks ask for it

#

This can happen on any future payment, whether or not the card was previously authenticated, and is entireyl at the customer banks discretion

vital flint
#

paymentIntent are being created on beta with status action required in test mode

river current
#

What beta are you referring to? Yes requires_action is the status when additional actions (like 3ds) are needed for complete payments.

#

What was the issue with your tests?

vital flint
#

sorry beta is our env where we are using test mode

river current
#

the x3155 card will require 3ds on the first PI/SI, but then not for future off session payments

#

the x3184 card will require 3ds for every payment, even after you set it up, so you can test your recovery flow