#ll0071 - confirmPayment

1 messages ยท Page 1 of 1 (latest)

dusk eagle
#

HI ๐Ÿ‘‹
What seems to be the issue?

lament thistle
#

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

dusk eagle
lament thistle
#

So I could put the paymentIntent Id in the confirmParams object, right ? Along with the stripe elements object

dusk eagle
#

Nope, not at all

lament thistle
#

What I want to do, is to use an old paymentIntent that didnt go throught and re send it to stripe

dusk eagle
#

Do you need to attach a new payment method?

lament thistle
#

no It would be the same as the original one

dusk eagle
lament thistle
#

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

dusk eagle
#

If you're using .NET, yes.

lament thistle
#

My back end is in c sharp

dusk eagle
#

Okay yeah, that should work.

lament thistle
#

Thank you!

dusk eagle
#

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.

lament thistle
#

Could I change some parameter too, like put off_session to false

dusk eagle
#

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

lament thistle
#

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

dusk eagle
#

Yeah if off_session is false, it means the customer is the one doing the actions.

lament thistle
#

Ok so there is no way to set it to false when using the .NET back-end code I posted earlier?

dusk eagle
#

Not for confirming on the server side

lament thistle
#

but if I do it on the front-end with stripe.confirmPayment(options), I cant pass the payment Intent Id, right ?

dusk eagle
#

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

lament thistle
#

I already have the payment info, why would it allows me to confirmPayment with the payment intent id

#

maybe I dont understand sorry

dusk eagle
#

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.

lament thistle
#

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

dusk eagle
#

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

lament thistle
#

The payment element is already 3D auth when the payment method get created. Its for when it ask for it on charging

dusk eagle
#

So what is failing then?

#

Do you have the Payment Intent ID? So I can review the history?

lament thistle
#

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

dusk eagle
#

Okay so yeah you created the PI with an existing Payment Method.

lament thistle
#

Yeah. And now I want to do the exact same transaction but with off_session = false so the customer can 3D auth

dusk eagle
#

Start over, make a brand new PI

lament thistle
#

Yeah ok I guess its my only choice. I just wanted to see if I got other option

dusk eagle
lament thistle
#

yeah because when the payment intent gets created the customer is not there. He is always offline

#

what happend when confirm = false ?

dusk eagle
#

Did you collect the Payment Method specifically for off_session usage?

#

Did you use a Setup Intent?

lament thistle
#

yes

#

exactly

#

why ?

dusk eagle
#

It gave me something else to check. It does look like the initial 3DS auth went through just fine.

lament thistle
#

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 ?

dusk eagle
#

If by "it" you mean 3DS. It does appear that the issuing bank is requesting it again.

lament thistle
#

Yes exactly. But Ill just create a whole new Payment intent. I guess its the only way

#

Thank you for your time!