#slcoder

1 messages · Page 1 of 1 (latest)

worldly nimbusBOT
carmine nexus
#

Can you clarify what you mean by "wrong PI"? Like, was the amount charged ultimately incorrect?

dusky wharf
#

wrong "PI" : wrong payment intent, yes, it was wrong amount as well.

#

sorry for inconvenience

carmine nexus
#

How did that happen exactly?

dusky wharf
#

basically our checkout page has a wizard , each we collect different data, and we need to update the payement intent since amount could change due to changes on each stages...,

#

but in my backend im checking payment intent on each update , if it existing only i update the data, otherwise i will create a new payment intent.

#

I'm using PaymentIntentService/GetAsync to identify the payment intent already exists or not.

#

so , as the last step we have payment page, once user click on confirm button, we do the final payment.

#
  1. First checkout loads with first page,once user fill basic info, and save, then frontend call the server api for create payment intent.
  2. backend create payment intent and pass them to frontend.
  3. if there are any amount change due to other additional addons, then frontend call the update payment intent api, passing paymentintentid
    . Update api could call many time due amount changes.
  4. Frontend always take payment intent id from backend api. (getpaymentintent)
  5. Once all details has filled up, user click on confirm , then do final payment.
carmine nexus
#

Got it, thanks for the details

#

I'm not sure I follow how the wrong amount is being confirmed if step 4 above is happening (frontend gets the PI prior to confirming)

worldly nimbusBOT
dusky wharf
#

Initially, we have implemented that way, but, since there are multiple update for the payment intent, it took some longer time for us to get the response from stripe side, hence, we have initiate payment intent bit in early stage

vapid mango
#

Hello! I'm taking over and catching up...

#

Okay, so are you looking for help regarding what to do with the already-confirmed Payment Intents or are you looking for help with how to avoid this issue in the future?

dusky wharf
#

hi, yes I'm looking help to avoid this huge issue

#

can you please let me know, our process flow is correct above

vapid mango
#

The best way to avoid this issue is to only create the Payment Intent when you have the final amount.

dusky wharf
#

but we got a longer time to retrieve the payment intent.

#

genrally how long does it take to return payment intent from stripe?

vapid mango
#

I don't know the exact numbers, but should be pretty quick. What do you mean by "a long time to retrieve the payment intent"?

dusky wharf
#

sometime it took 1 min to get the payment intent response from stripe api.

vapid mango
#

That's highly unlikely. The Stripe API should be providing you with a Payment Intent in, at most, a few seconds.

#

Probably under one second.

#

Sounds like there might be a delay somewhere else.

dusky wharf
#

ok,

vapid mango
dusky wharf
#

then let me try to create one payment intent and pass it to the frontend