Test Payment Cards
This guide will provide you with all you need to know about testing with credit cards. We'll cover the different types of credit cards, how to use them, and what their respective responses mean.
Overview
Simulated transactions use dedicated card numbers to control transaction outcomes.
- Each test card number maps to a specific outcome
- Any unrecognized card number which passes LUHN validation is treated as a success
- Use any future expiration date, any CVV, and any billing address
- Amount and CVV values have no effect on the outcome
Success Cards
Use any of these cards to get an approved transaction.
| Brand | Card Number | TestCardEnum |
|---|---|---|
| Visa | 4242424242424242 | VISA |
| Visa Debit | 4000056655665556 | VISA_DEBIT |
| Mastercard | 5555555555554444 | MASTERCARD |
| Amex | 378282246310005 | AMEX |
| Discover | 6011111111111117 | DISCOVER |
Any card number not listed on this page (success or error) is also treated as success. Brand is auto-detected from the BIN pattern.
Error Cards
These cards simulate specific failure scenarios. Each card maps through a processing pipeline that produces a result and an errorCode in the API response.
Decline Cards (card/issuer rejected the transaction)
| Scenario | Card Number | Result | Error Code | Payment Status |
|---|---|---|---|---|
| Generic Decline | 4000000000000002 | DECLINED | TRANSACTION_DECLINED | DECLINED |
| Insufficient Funds | 4000000000009995 | DECLINED | TRANSACTION_DECLINED | DECLINED |
| Card Expired | 4000000000000069 | DECLINED | CARD_EXPIRED | DECLINED |
| Invalid Card | 4000000000000127 | DECLINED | INVALID_CARD_NUMBER | DECLINED |
| CSC Mismatch | 4000000000000101 | DECLINED | CSC_VERIFICATION_FAILED | DECLINED |
| AVS Mismatch | 4000000000000010 | DECLINED | ADDRESS_VERIFICATION_FAILED | DECLINED |
System Error Cards (infrastructure/processor-level failures)
| Scenario | Card Number | Result | Error Code | Payment Status |
|---|---|---|---|---|
| Timeout | 4000000000009987 | UNKNOWN | TRANSACTION_FAILED | FAILED |
| Network Error | 4000000000000119 | ERROR | TRANSACTION_FAILED | FAILED |
| Processor Error | 4000000000000341 | FAILURE | TRANSACTION_FAILED | FAILED |
Understanding Result vs Error Code
The API response contains two independent fields for error scenarios:
result-- The system-level outcome category. Tells you what kind of problem occurred.errorCode-- The user-facing error classification. Tells you what to display or act on.
These are derived independently, mirroring how real processors (e.g., Mastercard) map a single processor response code to both a result and an error code separately.
Why do system errors all show TRANSACTION_FAILED?
For system/infrastructure errors (timeout, network error, processor error), the errorCode is intentionally normalized to the generic TRANSACTION_FAILED. The internal details (timeout vs network vs processor) are not exposed to API consumers. Instead, the result field differentiates them:
| Result | Meaning |
|---|---|
SUCCESS | Transaction processed successfully |
DECLINED | Card/issuer declined the transaction (try a different card) |
UNKNOWN | Outcome is indeterminate -- the transaction may or may not have gone through (e.g., timeout) |
ERROR | A system error occurred on our side (e.g., network failure) |
FAILURE | The transaction definitively failed (e.g., processor rejected it) |
This matches Mastercard's real processor behavior where TIMED_OUT maps to ResultEnum::UNKNOWN + TransactionErrorEnum::TRANSACTION_FAILED.
Card Present Test Terminals (TIDs)
Card present transactions use Terminal IDs (TIDs) instead of card numbers to control transaction outcomes. Pass the TID as the terminal parameter in the pay request.
- Each TID maps to a specific outcome
- Any TID not in the list below returns
CARD_PRESENT_INVALID_TERMINAL - TID values are the error code names themselves, making test scenarios self-documenting
Success Terminal
| TID | Description |
|---|---|
SUCCESS | Approves all card present transactions successfully after internal validation |
Decline Terminals (card/issuer rejected the transaction)
| Scenario | TID | Result | Error Code | Payment Status |
|---|---|---|---|---|
| Generic Decline | TRANSACTION_DECLINED | DECLINED | TRANSACTION_DECLINED | DECLINED |
| Card Expired | CARD_EXPIRED | DECLINED | CARD_EXPIRED | DECLINED |
| Debit Requires PIN | DEBIT_REQUIRES_PIN | DECLINED | DEBIT_REQUIRES_PIN | DECLINED |
| EULA Disagreed | EULA_DISAGREED | DECLINED | EULA_DISAGREED | DECLINED |
Terminal Interaction Errors (device-level issues)
| Scenario | TID | Result | Error Code | Payment Status |
|---|---|---|---|---|
| Customer Aborted | CARD_PRESENT_ABORTED | FAILURE | CARD_PRESENT_ABORTED | ABORTED |
| Terminal Timeout | CARD_PRESENT_TIMEOUT | FAILURE | CARD_PRESENT_TIMEOUT | ABORTED |
| No Processor Response | CARD_PRESENT_NO_RESPONSE | FAILURE | CARD_PRESENT_NO_RESPONSE | FAILED |
| Remove Card | CARD_PRESENT_REMOVE_CARD | FAILURE | CARD_PRESENT_REMOVE_CARD | FAILED |
| Duplicate Transaction | CARD_PRESENT_DUPLICATE | FAILURE | CARD_PRESENT_DUPLICATE | FAILED |
| Cannot Connect | CARD_PRESENT_CANNOT_CONNECT_TO_DEVICE | -- | CARD_PRESENT_CANNOT_CONNECT_TO_DEVICE | -- |
Cannot Connect is special: the processor was never reached, so the transaction record is deleted entirely. No result or payment status is returned -- the pay request fails with an error response.
System Error Terminals (infrastructure/gateway-level failures)
| Scenario | TID | Result | Error Code | Payment Status |
|---|---|---|---|---|
| Gateway Error | GATEWAY_ERROR | ERROR | TRANSACTION_FAILED | FAILED |
| Timeout | TIMEOUT | UNKNOWN | TRANSACTION_FAILED | FAILED |
System error TIDs normalize the error code to
TRANSACTION_FAILED(same behavior as the CNP system error cards). Theresultfield differentiates them.
Updated 4 days ago
