#ll0071 - confirmPayment
1 messages ยท Page 1 of 1 (latest)
I was wondering, can I just pass the payment intent Id directly in the function, like this :stripe.ConfirmPayment(paymentIntentID)
or do I need to pass an object
with multiple information
the confirmPayment function is used to collect payment method details and confirm the payment intent in one request. You need to provide the Stripe Element object as well as the required confirm parameters.
https://stripe.com/docs/js/payment_intents/confirm_payment
You can see an example of the entire process end-to-end here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
So I could put the paymentIntent Id in the confirmParams object, right ? Along with the stripe elements object
Nope, not at all
What I want to do, is to use an old paymentIntent that didnt go throught and re send it to stripe
Do you need to attach a new payment method?
no It would be the same as the original one
Then you can do that from the server side: https://stripe.com/docs/api/payment_intents/confirm
ok, so I could just use that
var service = new PaymentIntentService();
service.Confirm(
"pi_1EUmy5285d61s2cIUDDd7XEQ",
options);
with my desire Payment intent ID
to initiate the payment
If you're using .NET, yes.
My back end is in c sharp
Okay yeah, that should work.
Thank you!
Sure thing, happy to help ๐
Depending on how/when you collected the Payment Method info, you may need to bring the user back on-session to re-authenticate the Payment Method.
Could I change some parameter too, like put off_session to false
If you review the doc I linked earlier (select .NET for back-end code snippets to see C#) you can see how to handle that.
You cannot reset that on the Payment Intent after you created it
ah. because if off_session = true, the 3D auth usually dont trigger
So in that case im better with creating a whole new payment intent
Yeah if off_session is false, it means the customer is the one doing the actions.
Ok so there is no way to set it to false when using the .NET back-end code I posted earlier?
Not for confirming on the server side
but if I do it on the front-end with stripe.confirmPayment(options), I cant pass the payment Intent Id, right ?
Yeah, you would need to create a Payment Element with the client_secret
Then use that Payment Element to collect new payment info and then confirm the PI
I already have the payment info, why would it allows me to confirmPayment with the payment intent id
maybe I dont understand sorry
The only reason to use the JavaScript approach is if you have the user interacting directly with your application. Otherwise you should just the server-side approach I linked earlier.
Yes he is interacting directly. This is what happens : the client try to charge a 3D auth card, it get decline cause off_session = true, we send email to customer to get him back on session so we can start the 3D auth workflow. I have the payment intent Id that first failed and all the card info too. So what is the best approach here
Okay so you do still need to go through the 3DS auth process. You will want to create the Payment Element so Stripe.js can handle the 3DS auth
The payment element is already 3D auth when the payment method get created. Its for when it ask for it on charging
So what is failing then?
Do you have the Payment Intent ID? So I can review the history?
When I charge a card with 3D auth, it failed because the off_session = true so the customer is not there
pi_3LDFeTKZEpng7hVc1Nj2z0uZ
for example
Okay so yeah you created the PI with an existing Payment Method.
Yeah. And now I want to do the exact same transaction but with off_session = false so the customer can 3D auth
Start over, make a brand new PI
Yeah ok I guess its my only choice. I just wanted to see if I got other option
You also used off_session without included confirm=true. The only time you pass off_session is when confirm=True.
https://stripe.com/docs/api/payment_intents/create#create_payment_intent-off_session
Kind of a pain I know but it's part of what didn't work.
yeah because when the payment intent gets created the customer is not there. He is always offline
what happend when confirm = false ?
Did you collect the Payment Method specifically for off_session usage?
Did you use a Setup Intent?
It gave me something else to check. It does look like the initial 3DS auth went through just fine.
yes when the card is set up
it ask for it
but since it can also ask on every transaction
we need to implement it
right ?
If by "it" you mean 3DS. It does appear that the issuing bank is requesting it again.