ruby-on-railsstripe-payments

Stripe—test cards with insufficient funds


There are some test credit card numbers, e.g. Visa's 4111 1111 1111 1111, and when you test with these cards, it is always a successful transaction.

How do I test a declined transaction? E.g. if the card is valid but doesn't have enough money for the transaction?


Solution

  • You can use the card number 4000 0000 0000 0002 or token "tok_chargeDeclined" to get a declined test charge: https://stripe.com/docs/testing#cards