#slcoder
1 messages · Page 1 of 1 (latest)
Can you clarify what you mean by "wrong PI"? Like, was the amount charged ultimately incorrect?
wrong "PI" : wrong payment intent, yes, it was wrong amount as well.
sorry for inconvenience
How did that happen exactly?
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.
- First checkout loads with first page,once user fill basic info, and save, then frontend call the server api for create payment intent.
- backend create payment intent and pass them to frontend.
- 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. - Frontend always take payment intent id from backend api. (getpaymentintent)
- Once all details has filled up, user click on confirm , then do final payment.
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)
You could also look into creating a PaymentIntent only after you're sure no other changes are being made to the amount on the frontend and after you've collected payment details from the customer: https://stripe.com/docs/payments/accept-a-payment-deferred
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
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?
hi, yes I'm looking help to avoid this huge issue
can you please let me know, our process flow is correct above
The best way to avoid this issue is to only create the Payment Intent when you have the final amount.
but we got a longer time to retrieve the payment intent.
genrally how long does it take to return payment intent from stripe?
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"?
sometime it took 1 min to get the payment intent response from stripe api.
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.
ok,
Happy to take a closer look though if you can give me the request ID showing one of the Payment Intent requests that took a long time? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
then let me try to create one payment intent and pass it to the frontend