#Ammar-CardException-3DS
1 messages ยท Page 1 of 1 (latest)
Hi ๐ can you clarify what action you're taking when you encounter the exception?
I am confirming a payment intent server side
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?
Not if you create it and confirm it in one step.
ah, good point
Any luck @sterile atlas ?
Not yet, I've been trying to set up a test case but it's taking longer than expected. Have you tried echoing param from the exception? I think that's where the info would most likely be stored.
https://stripe.com/docs/api/errors/handling?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah, I tried that. Its empty. ๐ฆ
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
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.
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
Manual capture mode, aka placing a hold on the card and then "capturing" the funds later https://stripe.com/docs/payments/capture-later
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.
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
Ok, thanks for that. Did not know that capture functionality existed. Thanks!