#canopus1io
1 messages · Page 1 of 1 (latest)
I don't think you can do anything with the Payment Method after that, since we only get that error back from the bank when an account is no longer open. It's in an unusable state in other words. So, handling that error requires that you create a new account entirely.
so, I should handle specific payment error messages and delete the payment method immediately?
what about the other cases, Account closed makes sense to delete the payment method
You don't really need to delete the Payment Method, but deleting it could help to make sure it isn't confused as a viable option for payment.
There are many different error messages for payment failures, so I can't really say how to handle every individual one: https://stripe.com/docs/declines/codes
these are primarily from card payment methods, though
Ah, here's a list that's more relevant: https://stripe.com/docs/error-codes
if I don't delete it, then the user will see this card as usable and attempt to charge it, and then it generates invalid stripe request exceptions
If your app is set up to show that Payment Method, then yes you'd want to delete it
I have not found a way to filter it out, that was what I wanted to do initially
i could not find an attribute on the PaymentMethod object to indicate this state (invalid mandate)
one sec, let me get an example of the payment method data i have
I don't think there is a way to tell from the Payment Method. Your best bet would be deleting the Payment Method when the payment fails. If you can't delete it, then you should set up a webhook that listens for payment failures and sets metadata on the Payment Method object that tells you it is invalid.
there must be a list of errors that invalidates and existing mandate for bank accounts
not all ACH errors do this, an example is Insufficient funds.
The closest thing we have to a list of errors is this list of test account numbers for testing different payment outcomes on ACH Direct Debit: https://stripe.com/docs/payments/ach-debit#test-account-numbers
Not sure if this helps, but you can get information about the last payment error via last_payment_error on the Payment Intent object, which would tell you why the last payment was declined: https://stripe.com/docs/error-handling#use-stored-information
based on this, the it seems the only error message that the payment method is still usable is 'insufficient funds', for all the others, the payment methods are no longer usable.
does this sound right?
Yeah, that sounds right
I get info about the status of the charge from the charge object's failure_code and failure_message
"failure_code": "no_account",
"failure_message": "The customer's bank account could not be located.",
ok, thanks for your help, I'm going to work on the implementation
I'll post back here if I have further questions on this topic