#Ammar-CardException-3DS

1 messages ยท Page 1 of 1 (latest)

sterile atlas
nimble bronze
#

stripe-php

#

Forgot to mention

sterile atlas
#

Hi ๐Ÿ‘‹ can you clarify what action you're taking when you encounter the exception?

nimble bronze
#

I am confirming a payment intent server side

sterile atlas
#

Let me see if that information is in the exception somewhere, but if you're confirming the Payment Intent then don't you already know its ID?

nimble bronze
#

Not if you create it and confirm it in one step.

sterile atlas
#

ah, good point

nimble bronze
#

Any luck @sterile atlas ?

sterile atlas
nimble bronze
#

Yeah, I tried that. Its empty. ๐Ÿ˜ฆ

junior hazel
#

Can you send the params you are using to make this call? IIRC I ran in to something similar with the Python library but it was based on what was passed in to the create function

nimble bronze
#

Sure, give me a sec.

#

Hmm, do you mean the params to make the payment intent?

#

*create

#

Well, I just found it based on Toby's reply.

I did $exception->getError()->payment_intent->id

That returns the payment_intent's id.

$exception->getError()->param is null.

So, thanks for that! That's sorted

#

I do have another question.

Let's say I need to do some checks on the backend before taking a users payment. Is it possible to create the payment_intent client side, prompt 3DS and get the user to authenticate the payment, and then if required and everything is ok on the backend confirm the payment_intent sever side (take the money from the customer).

#

@junior hazel Apologies for the ping. Just not sure if anyone has read my message.

junior hazel
#

Apologies. Got pulled in to something else. On this now

#

If I understand your flow now, the funds would be captured as soon as the user completes 3DS on their side

#

If you want to delay that until it gets back to your server, you can do manual capture, but that may not be necessary depending on what you are going for

nimble bronze
#

No worries, that is understandable.

#

Could you clarify what you mean by capture?

junior hazel
nimble bronze
#

Currently, we take the details for customers booking. Do some checks server side, then if all is well we attempt to charge them by creating and then confirming a payment_intent, if successful we send of some emails to confirm everything was successful.

#

The issue is, if 3DS is prompted we have to cancel the booking.

#

Instead, I was thinking I could use the payment_intent (if it fails requiring 3DS) and confirm it again client side and let the user complete 3DS.

#

But Toby gave me the idea to create the payment_intent client side.

#

Prompt 3DS and get the customer to authenticate the payment.

#

Then confirm it server side after we complete some checks.

junior hazel
#

You can do it either way here. I think your flow would be pretty similar

#

Without the hold, you would listen to the payment_intent.succeeded event and could handle the booking then.

With the hold flow, you would listen to payment_intent.amount_capturable_updated and then complete the capture and notify them of the booking

nimble bronze
#

Ok, thanks for that. Did not know that capture functionality existed. Thanks!