Search code examples
node.jsstripe-paymentsstripe-payment-intent

How to check if a PaymentMethod is valid or has sufficient funds before attempting to charge a Customer?


I am using stripe. Each of my customers has a PaymentMethod stored for future billing. Is it possible to check the method before billing? For example, checking if the card has expired or if it has the sufficient funds required for the charge?

In other words, somehow to get guarantee that if the method is charged the specified amount then it will go through.


Solution

  • No, that's not generally how card payments work. It's best to treat things such that any payment attempt at any time could fail and handle that outcome robustly by e.g. communicating to the customer to use a different payment method, or retrying the payment.

    You can potentially do things like use auth-and-capture to 'hold' an amount on a card, and be guaranteed to be able to capture that later(https://stripe.com/docs/payments/place-a-hold-on-a-payment-method), depending on the use case.