#Ammar - 3ds

1 messages · Page 1 of 1 (latest)

jagged canopy
sacred sparrow
#

Sure, 1 sec

#

req_VIkdtocCuit351

#

This is an off_session payment.

#

And I want it to fail and throw the exception, its just I then need to re-confirm the payment_intent client side when I get the customer back on session to complete 3DS for the transaction.

#

Any idea how to do this @jagged canopy ?

jagged canopy
#

Looking, thanks

#

ah

#

With off session payments you won't get requires_action since you've indicated the customer is not present

#

So you have two choices:
1/ Keep using off-session, and upon decline (payment intent reverts to requires_payment_method)you get your customer on session and confirm the payment client side
2/ Stop using off-session and if the response leads to requires_action you similarly get your customer online to confirm client side with with the PM already set on the PI

sacred sparrow
#

How do I go with option 1?

I have the following code:

stripe.handleCardAction()

I am assuming I have to use a different method?

jagged canopy
#

For path 1/ you'd use confirmCardPayment and provide a payment method either as a card element or an existing payment method

sacred sparrow
#

Meaning I create a whole new payment intent?

jagged canopy
#

Nope, you can use the same payment intent / client secret

#

You just need to confirm it again with the customer online to handle those auth actions

sacred sparrow
#

Ah, in that case do I need to pass the payment method?

jagged canopy
#

Yes, you can either provide the PM id or a new PM by providing a card element that your customer has filled out with new payment details

sacred sparrow
#

Hmm, the docs say the payment_method is optional?

jagged canopy
#

It's optional at the request level, yes, but the payment needs one in order for you to confirm it

sacred sparrow
#

Not sure I understand that? Why would it not be required if I NEED it?

jagged canopy
#

It can be supplied in several different ways. It's not required at the request level, even though it is required overall.

#

You can create a payment intent without a PM, update its amount or description perhaps several times, then provide a PM later before you confirm it.

sacred sparrow
#

Is there anyway to get the payment method used last time from a payment intent that has failed off_session?

bright parcel
sacred sparrow
#

Nice, can't believe I missed that!

#

Thanks