#Sébastien
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- Sébastien, 6 days ago, 26 messages
Hi, let me help you with this.
Hello, thanks !
Did you receive the invoice.payment_failed webhook event? And you want to access the related PaymentIntent object?
This even has the Invoice object as payload. So you can access the payment_intent property: https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Yes, exactly. Is it not working?
This is an error in your own server, I don't know why it happened.
Ok thank you but we agree that this is the right way to proceed on stripe's side ?
It looks fine, but we won't know until you check if it actually working. Do you know where does the 500 error come from, on your side?
Not yet, I will check
To retrieve the Status of the payement intent ... this is the right thing to use : $event->data->status; ?
No, that's the status of the Invoice.
I see you retrieve the PaymentIntent there but you don't use it for anything.
You can save it and access it's status:
$payment_intent = $stripe->paymentIntentns->retrieve(...)
$status = $payment_intent->status
Ok thanks, I just have to use the code above to have the status of the payment intent, right ?
Why are you retrieving the PaymentIntent in your code otherwise?
I need to check if the payment is in "requires_action"...
In my case... When I have a Invoice Payement Failed... I send an email to my customer systematically. But I don't want to send an email when I have a verification 3D secure (so when the payement intent is in requires actions state).
So i need to check the status of the payement intent... and choose to send (or not) and email to my customer
You can rely on Invoice status for this.
invoice.payment_failed event is a legit reason to notify the customer that the payment failed.
Yes ok, but... when I have a payment with 3D secure verification... I have systamatically and Invoice Payement Failed (du to the 3D secure check), and after, the verification, the payement intent is successful...
That's why I need to verify why the payement intent is failed...
Maybe I can only check the Invoice Status to verify if the payement is in Requires Action state ?
You can use this code to verify the status of the PaymentIntent in your webhook handler.
Ok I will try, thanks ! 🙂
Happy to help.