#ashishchicmic
1 messages · Page 1 of 1 (latest)
When the user fails to complete the authentication, the invoice payment will fail that invoice.payment_failed event will be sent: https://stripe.com/docs/billing/subscriptions/webhooks#events
Actually there is always an extra invoice.payment_failed event is triggered. Earlier I ask one of moderator and he told me to ignore that event if payment_intent of that invoice has a status of required action
I'm confued now how should I check that in which case I'll know that authentication have failed
Can you share an example invoice ID (in_xxx) for the scenario you mentioned?
for exp for id in_1NgKoRDSatVzNODcLZExHg3I , two invoice.payment_failed are triggered
i read somewhere that if paymentIntent's status is 'requires_payment_method' than it means authentication has been failed. Is that the case?
When you receive any invoice.payment_failed, this means that payment on the invoice has failed and its underlying Payment Intent status will moved from requires_action to requires_payment_method, for example: https://dashboard.stripe.com/test/payments/pi_3NgKoSDSatVzNODc1Xu6TQp3
When the Payment Intent status in requires_authentication, you should bring customer back to collect the new payment method
My scenerion is if the payment for the subscription is failed then I have to remove user from database.
Should I put a check on status == requires_authentication?
If the customer hasn't completed the authentication, the Payment Intent status will be requires_action.
If the customer fails the authentication, Payment Intent status will move to its initial status of requires_payment_method. There is no such status with requires_authentication.
If you use split Card Element to collect the payment method, you should be able to
- Get the
errorfrom thestripe.confirmCardPaymentto determine whether it's an authentication failure; or - Upon completing the payment, use Payment Intent API to check the
latest_payment_error: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-last_payment_error - Listen to
payment_intent.payment_failederror and check iflast_payment_erroris present
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.