#mark-invoice-failure-event
1 messages ยท Page 1 of 1 (latest)
Hi ๐ no, not directly in that event. You can retrieve the Payment Intent for the Invoice via the Payment Intent ID included in the event, and then reference the last_payment_error field there to see if the payment failed due to an authentication requirement.
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-last_payment_error
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
last_payment_error seems to be null in this scenario.
Can you share the ID of an event that you're referencing?
evt_1LUVmaDvkBSqGgYfVyR5xsNc
next_action in the payment intent seems to have something related to "three_d_secure_redirect" but not sure I can rely on this?
last_payment_error isn't populated there because so far the Payment Intent has not encountered an error. The status parameter being set to requires_action is the indicator that additional action must be taken for this Payment Intent.
Thanks. So:
last_payment_error === null && status === 'requires_action'
would be a good indicator that I'm in a situation where authentication is required?
You can drop the first part of that check, requires_action by itself is an indicator that additional action needs to be taken. You can review more about the lifecycle of an Intent here:
https://stripe.com/docs/payments/intents
OK - thanks. That looks like it should be specific enough to determine whether authentication is required.