#antoineb_docs

1 messages ยท Page 1 of 1 (latest)

glass fableBOT
#

๐Ÿ‘‹ 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/1415257066506817607

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

visual niche
#

So, just to summarize :
Currently I have :

  • CardElement with payment intent creation + confirmation on the server
  • PayPal, with client asking for payment intent creation on the server then confirms it (with redirectio and so on)

We want to migrate to PaymentElement, and first I saw that Stripe suggests that the PayPal flow we currently have should be generalized (if I understand well) But we're not super comfortable because currently our flow is not super robust with paypal (the booking is created after the redirection, the client asks it directly instead of via a webhook).

But then I saw this doc :
https://docs.stripe.com/payments/finalize-payments-on-the-server
And wonder if we could do this and how it would work with PayPal

Build an integration where you render the Payment Element before you create a PaymentIntent or SetupIntent, then confirm the Intent from your server.

spark moth
visual niche
#

thanks, looking into it right now

#

so, just to be sure I understand what you just sent, this would make Paypal payments be confirmed on the server?
And this would work well with payment Element ?
Would that work with stripe React native as well?

spark moth
#

Yes, you can confirm them server-side either via confirm: true or using the /confirm endpoint. But as I said it'll just transition to a requires_action for you to manually handle the redirect

And this would work well with payment Element ?
I don't believe so, you'd likely need a Confirmation Token for that: https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment

Would that work with stripe React native as well?
Not sure to be honest, I'd need to check. I believe so

Build an integration where you render the Payment Element before you create a PaymentIntent or SetupIntent, then confirm the Intent from your server.

visual niche
#

thanks, I saw the confirmation token logic. Would this confirmation token logic would work with paypal as well then? The idea would be to use payment element for all payment methods, and it would be better for us to use the confirmation token logic for cards, so I was wondering if this was OK with paypal

spark moth
#

Yes, CT works with most PMs inc. PayPal

visual niche
#

thanks, and how the redirection is handled if we use CT then? ๐Ÿค”

spark moth
visual niche
#

amazing! thank you for pointing me to the right info ๐Ÿ™

#

I'm not a front end dev, but my workmate told me that things were always a bit different with stripe react native. Does the confirmation token logic works also with payment element in stripe react native?

spark moth
visual niche
#

ah :/ and no server side confirmation at all on stripe react native then?

spark moth
visual niche
#

ah yes, but since we want to migrate to PaymentElement for both web and app I guess we're stuck ? Since the flow you mention is not with payment element, and the CT is with payment element

spark moth
visual niche
#

thanks, looking into it

#

Maybe I'm not front-end tech savy enough, but I'm not sure how this would allow server side payment confirmation for payment element react native ๐Ÿค”

spark moth
#

Because you'd tokenize the PM data selected (be that card, PayPal) in the Payment Element via createPaymentMethod and send the resulting pm_xxx ID to your backend to confirm the intent

visual niche
#

and if the user re-uses a payment method instead of creating one?

spark moth
#

Well how are you enabling that re-use functionality? But you'd just skip the createPaymentMethod part and instead send the existing, chosen pm_xxx ID to the server-side and the flow is identical

visual niche
#

ok, I see. I'd have to ask the frontend team how they would do it.
Thank you, I'm going to check with my team. You've been super helpful ๐Ÿ™

spark moth
#

No problem, glad I could help!