#ashishchicmic

1 messages · Page 1 of 1 (latest)

haughty orioleBOT
real zinc
valid moon
#

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

real zinc
#

Can you share an example invoice ID (in_xxx) for the scenario you mentioned?

valid moon
#

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?

real zinc
#

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

valid moon
#

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?

real zinc
#

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

  1. Get the error from the stripe.confirmCardPayment to determine whether it's an authentication failure; or
  2. 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
  3. Listen to payment_intent.payment_failed error and check if last_payment_error is present
valid moon
#

ok

#

One thing more, suppose a user fails the authentication and later updates the payment method then in that case it will autmatically deduct the amount for the subscription?