#Sébastien

1 messages · Page 1 of 1 (latest)

woeful roseBOT
#

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.

glossy lily
#

Hi, let me help you with this.

glass talon
#

Hello, thanks !

glossy lily
#

Did you receive the invoice.payment_failed webhook event? And you want to access the related PaymentIntent object?

glass talon
#

Of course

#

I try something like this

glossy lily
glossy lily
glass talon
#

No... Is this the right way to do it?

#

I have a 500 error

glossy lily
#

This is an error in your own server, I don't know why it happened.

glass talon
#

Ok thank you but we agree that this is the right way to proceed on stripe's side ?

glossy lily
#

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?

glass talon
#

Not yet, I will check

#

To retrieve the Status of the payement intent ... this is the right thing to use : $event->data->status; ?

glossy lily
#

No, that's the status of the Invoice.

glossy lily
# glass talon

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
glass talon
#

Ok thanks, I just have to use the code above to have the status of the payment intent, right ?

glossy lily
#

Why are you retrieving the PaymentIntent in your code otherwise?

glass talon
#

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

glossy lily
#

You can rely on Invoice status for this.

#

invoice.payment_failed event is a legit reason to notify the customer that the payment failed.

glass talon
#

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 ?

glossy lily
glass talon
#

Ok I will try, thanks ! 🙂

glossy lily
#

Happy to help.