Matthew Daly
Matthew Daly

Reputation: 9476

Catching API response for insufficient funds from Stripe

If I create a Charge object via the Stripe API and the card is valid, but the charge is declined, what error does this cause? It doesn't look to be possible to simulate this error in the test sandbox and I'd like to be able to catch it (and mock it in tests), but the documentation isn't clear on this point.

Upvotes: 1

Views: 1203

Answers (1)

Matthew Arkin
Matthew Arkin

Reputation: 4648

That would trigger a declined charge which is a card_error and can be triggered with this card number: 4000000000000002: Charge will be declined with a card_declined code.

Upvotes: 2

Related Questions