#tarantino_payment-flow

1 messages ยท Page 1 of 1 (latest)

terse hearthBOT
stable kindleBOT
#

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.

terse hearthBOT
#

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

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

stable kindleBOT
south fossil
#

Hi ๐Ÿ‘‹

Setup Intents are only used to save payment methods without charging them

#

Payment Intents are the only Intent you can use to collect funds

blazing fable
#

can't I create payment method using payment element and setup intent and then use that new payment method for future payments and for immediate payment?

south fossil
#

You can but it's an anti-pattern

#

You make extra API requests

#

And can incur more fees due to repeated authentication

blazing fable
#

hm

#

on another note

#

on the regular payment element flow. I created client secret and rendered payment element. now what if amount got changed after I created a payment intent, I assume I need to update it. how to do that?

south fossil
blazing fable
#

hm

#

sorry, I mean update payment intent on the BE

south fossil
#

Yes

#

You can only update the payment intent on the backend

#

After it is updated, you then use the fetchUpdates() function to refresh the Payment Element with the new data

#

Otherwise your Payment Intent and your Payment Element will not be in sync

blazing fable
#

good to know ,thanks
I'm gonna describe my whole stripe payment flow right now and would like you to review

stable kindleBOT
subtle pilot
#

tarantino_payment-flow

blazing fable
#

sending ping to keep the thread opened

subtle pilot
blazing fable
#

no, just one question

blazing fable
#

so once user opens my chekout page I make reques to the BE, BE creates payment intent and returns client secret in the response. Then FE renders stripe Payment Element using client secret. Then user can select paid shiiping options and amount may be changed - if so FE makes a request to the BE for updating Payment Intent, then FE uses fetchUpdates() in order to refresh Payment Element. Then once user clicks on the submit -> FE confirms Payment Intent.

subtle pilot
#

yes

blazing fable
#

how does it look like to you?

subtle pilot
blazing fable
#

just a minute

#

ok, so when I call confirmPayment clientSecret already contains order amount in it, right?

// Confirm the PaymentIntent using the details collected by the Payment Element const {error} = await stripe.confirmPayment({ elements, clientSecret, confirmParams: { return_url: 'https://example.com/order/123/complete', }, });

subtle pilot
#

sorry I don't really get your question. What is the exact issue you are hitting while trying to do that? I gave you 2 different integration paths which work completely differently

subtle pilot
#

Sure but that's a brand new doc you just read right? I don't really get what you were asking but maybe it's just confusion. So yes you use confirmPayment() after the PaymentIntent is created

blazing fable
#

Sure but that's a brand new doc you just read right?
yes

#

one more question

subtle pilot
#

sure!

blazing fable
#

how can I make sure the payment went through from the client side?

#

since webhooks are only for the BE

#

do I need to make a request to stripe every 1-3 sec (retrieve payment intent) and check the status?

subtle pilot
#

Have you tried the flow yet? You likely should to fully understand how this all works. PaymentElement will redirect after the payment is complete

blazing fable
#

I tried last year
ok, I'll try

#

thank you, have a good one

subtle pilot
#

this thread will stay open for a bit, so once you have tried, let me know if you have a follow up question!