Testing Cards
Successful Response Cards
In test mode, you can use these test cards to simulate a successful transaction:
| Number | Card type |
|---|---|
4242424242424242 | Visa |
4012888888881881 | Visa |
5555555555554444 | MasterCard |
5105105105105100 | MasterCard |
378282246310005 | American Express |
371449635398431 | American Express |
6011111111111117 | Discover |
6011000990139424 | Discover |
30569309025904 | Diner's Club |
38520000023237 | Diner's Club |
3530111333300000 | JCB |
3566002020360505 | JCB |
Special Response Cards
These cards will produce specific responses that are useful for testing different scenarios:
| Number | Description |
|---|---|
4000000000000010 | With default account settings, charge will succeed but address_line1_check and address_zip_check will both fail. |
4000000000000028 | With default account settings, charge will succeed but address_line1_check will fail. |
4000000000000036 | With default account settings, charge will succeed but address_zip_check will fail. |
4000000000000044 | With default account settings, charge will succeed but address_zip_check and address_line1_check will both be unchecked. |
4000000000000101 | With default account settings, charge will succeed but cvc_check will fail if a CVC is entered. |
4000000000000341 | Attaching this card to a Customer object will succeed, but attempts to charge the customer will fail. |
4000000000000002 | Charges with this card will always be declined with a card_declined code. |
4000000000000127 | Charge be declined with an incorrect_cvc code. |
4000000000000069 | Charge be declined with an expired_card code. |
4000000000000119 | Charge be declined with a processing_error code. |
Additional test mode validation: By default, passing address or CVC data with the card number will cause the address and CVC checks to succeed. If not specified, the value of the checks will be null. Any expiration date in the future will be considered valid.
Testing Specific error codes
Some suggestions:
card_declined: Use this special card number -4000000000000002.incorrect_number: Use a number that fails the Luhn check, e.g.4242424242424241.invalid_expiry_month: Use an invalid month e.g.13.invalid_expiry_year: Use a year in the past e.g.1970.invalid_cvc: Use a two digit number e.g.99.
The full list of API error codes is available here.
Check the full Stripe documentation for more information on testing.