#mark-invoice-failure-event

1 messages ยท Page 1 of 1 (latest)

brave flame
#

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

hexed berry
#

last_payment_error seems to be null in this scenario.

brave flame
#

Can you share the ID of an event that you're referencing?

hexed berry
#

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?

brave flame
#

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.

hexed berry
#

Thanks. So:

last_payment_error === null && status === 'requires_action'

would be a good indicator that I'm in a situation where authentication is required?

brave flame
#

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

Learn about the status and lifecycle of PaymentIntents and SetupIntents.

hexed berry
#

OK - thanks. That looks like it should be specific enough to determine whether authentication is required.