#valdozzz_best-practices
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- valdozzz, 5 days ago, 42 messages
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ 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/1212158012844671037
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ 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. Thank you for your patience!
i've already accomplisehd to:
- create the customer in the platform account
- attach the pm to the customer
- clone the customer to the connected account
- attach the payment method to de connected customer
- create the payment intent using the connected account and the customer
now i need to figure out how to use the payment intent clientSecret to make the payment using the stripe element. im getting this error rn:
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such payment_intent: 'pi_3OoYaqH7OiDZuxRk1yHpzrTy'",
"param": "intent",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_1FFyr2qOOAG05r?t=1709070826",
"type": "invalid_request_error"
}
}```
Thanks for all the details! I see pi_3OoYaqH7OiDZuxRk1yHpzrTy was created on the Connected account as expected but the confirmation request (the request that failed) was made using the platform's publishable key
how should i make the confirmation then? :/
You'll need to pass the connected account's account ID client side, too: https://docs.stripe.com/connect/authentication?create-client=react#adding-the-connected-account-id-to-a-client-side-application
oh damn , so i do need another form? because i did one to get our users credit card and shipping info ( using platform pub key )
basically i have this form there.
and it does all the previous steps
Hold on a second, let's back up. I understand you're cloning payment methods from the platform to the connected account. Is that because you want the option of charging customers both from the platform and the connected account?
Or is your plan to charge customers from the connected account only?
nope, i have other connectred accounts, and i want to store the payment method so they can easly pay other accounts
and progressivvely clone the customers for each connected account
Gotcha, okay
I see you're also already using the deferred intent flow (collecting payment details before creating a PaymentIntent)
yep
You won't be able to do this all on one page since you're creating the PaymentMethod using the platform's publishable key but want to confirm the PaymentIntent with the platform's publishable key + the standard connected account ID
I recommend following this guide instead: https://docs.stripe.com/payments/build-a-two-step-confirmation
You'll still create the PaymentMethod first using the deferred intent flow but the confirmation/pay button should be on a different page
what if i make a charge server side and handle manually 3DS /
?
That could work but might get confusing for your customers if they have to come back on session for additional authentication
what do you mean?
I'm not sure how you plan on handling 3DS if you continue to use the form you have above
since im creating the payment intent, if there i s a "next action" ill send the link to the client that created an iframe with the 3ds action , then i'll create an endpoint to check if the payment intent is successfully charged, then i ill poll the enpoint to check when the payment intent is finshed / failed / cancelled
I recommend letting us handle any 3DS/next actions instead of requesting it manually and handling the redirect yourself
This really is the better flow: https://docs.stripe.com/payments/build-a-two-step-confirmation