About API exceptions, I need an explanation of the meaning of each exception received.

1,741 views
Skip to first unread message

Carlos Cano - STEL

unread,
Jul 14, 2014, 10:39:32 AM7/14/14
to api-d...@lists.stripe.com
About API exceptions, I need an explanation of the meaning of each exception received.


4000 0000 0000 0341 //Attaching this card to a Customer object will succeed, but attempts to charge the customer will fail.

Charge.create(chargeParams)  throws com.stripe.exception.CardException: Your card was declined. (code = "card_declined")
  • Card not supported by Stripe. 
  • Invalid card (either now or in the future)
  • You can't temporarily charge on that card (no funds, for example)
  • Technical problem (Stripe or others)
  • Other reasons: ____________________________________________


4000 0000 0000 0002 //Charges with this card will always be declined with a card_declined code.

Token.create(tokenParams) throws com.stripe.exception.CardException: Your card was declined. (code = "card_declined")

  • Card not supported by Stripe. 
  • Invalid card (either now or in the future)
  • You can't temporarily charge on that card (no funds, for example)
  • Technical problem (Stripe or others)
  • Other reasons: ____________________________________________


4000 0000 0000 0119 //Charge be declined with a processing_error code.

Token.create(tokenParams) throws com.stripe.exception.CardException: An error occurred while processing your card. Try again in a little bit.
  • Card not supported by Stripe. 
  • Invalid card (either now or in the future)
  • You can't temporarily charge on that card (no funds, for example)
  • Technical problem (Stripe or others)
  • Other reasons: ____________________________________________

Jim Danz

unread,
Jul 14, 2014, 7:59:45 PM7/14/14
to api-d...@lists.stripe.com
4000 0000 0000 0341 and 4000 0000 0000 0002 are designed to simulate
real declines from a bank. We don't know for sure whether the card is
not good at all, or whether it may just be declined for this
particular transaction. For instance, you could be attempting to
charge $200 to a debit card, where the customer has a current balance
below $200 (or the same for credit limit). So, essentially as you
said "You can't temporarily charge on that card (no funds, for
example)".

4000 0000 0000 0119 this is meant to simulate the card networks
telling us that there was a processing error. When this happens, it
can be reasonable to retry the card at a later time. It does not
indicate a technical problem with Stripe (for that, we would return a
500), but may be indicative of a temporary technical issue with one of
our banking partners.
> --
> You received this message because you are subscribed to the Google Groups
> "Stripe API Discussion" group.
> To post to this group, send email to api-d...@lists.stripe.com.
> Visit this group at
> http://groups.google.com/a/lists.stripe.com/group/api-discuss/.
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to api-discuss...@lists.stripe.com.

Carlos Cano - STEL

unread,
Jul 15, 2014, 3:49:57 AM7/15/14
to api-d...@lists.stripe.com
Thanks.

One more question:

With "4000 0000 0000 0002 //Charges with this card will always be declined with a card_declined code."

This is error is permanent?

Jim Danz

unread,
Jul 15, 2014, 4:03:18 AM7/15/14
to api-d...@lists.stripe.com
For the sake of deterministic behavior in test mode, 4000 0000 0000 0002 will always be declined with card_declined.

But you should note that in livemode, a card being declined with card_declined does not *necessarily* imply that charging that card will never succeed at any point in the future.

Carlos Cano - STEL

unread,
Jul 16, 2014, 10:10:45 AM7/16/14
to api-d...@lists.stripe.com
Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages