#dragosh-elements
1 messages · Page 1 of 1 (latest)
hello, give me a sec, catching up
Is there a way to do the custom checkout form for a standard connected account that uses the Payment Element?
yes
Can you please give me a link to the docs describing how to do it? Thanks.
it works the same way really
1/You first create a PaymentIntent on the Connect account
2/ Instantiate Stripe.js on your webpage as the Connect account
3/ Confirm the PaymentIntent on the PaymentElement
ah this doc hasn't been updated to PaymentElement (still on CardElement) but the concept is the same https://stripe.com/docs/connect/creating-a-payments-page?ui=elements&destination-or-direct=direct-charges
My assumption was also they are similar, but at the last step, when I try to use the client secret to retrieve the payment intent I get a 404 not found from the Stripe Server.
Mind that on the confirmation page where I'm taken by the checkout flow I don't have the connected account (I only get the payment intent and the client secret in the url query), thus I cannot initialise Spripe.js with it.
@wheat shuttle ah you mean on the return_url? are you trying to fetch the PaymentIntent client-side? with Stripe.js's retrievePaymentIntent() method?
Yes, just like in the docs: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
ah gotcha, so you can do a couple of things
1/ set the connect account ID as a cookie to persist it across the redirect, so that on the return_url redirect, if that cookie is present and you can init Stripe.js with the Connect account ID (and the Platform publishable key)
2/ you pass that PaymentIntent ID server-side and fetch it through a server-side roundtrip, on your server you would keep track of what Connect account this PaymentIntent was created on (like in a database table)