Stripe : Handle failing card ; unable to charge credit card

How can I test a failed invoice payment?

We recommend using the card number 4000 0000 0000 0341 to create a customer object. Since the card will be declined on any payment, we then recommend subscribing the customer to a plan with a short (ie. 1-2 minute) trial period by setting the trial_end parameter.

When the trial period ends, we’ll then create an invoice for the customer’s first billing period. Upon attempting to pay that invoice, the card will be declined and an invoice.payment_failed event will be generated along with the respective charge.failed event.

 

Main Sources:

https://stripe.com/docs/recipes/sending-emails-for-failed-payments

https://support.stripe.com/questions/test-failed-invoice-payment

http://benfoster.io/blog/stripe-failed-payments-how-to

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s