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.

BrandCard NumberTestCardEnum
Visa4242424242424242VISA
Visa Debit4000056655665556VISA_DEBIT
Mastercard5555555555554444MASTERCARD
Amex378282246310005AMEX
Discover6011111111111117DISCOVER

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)

ScenarioCard NumberResultError CodePayment Status
Generic Decline4000000000000002DECLINEDTRANSACTION_DECLINEDDECLINED
Card Expired4000000000000069DECLINEDCARD_EXPIREDDECLINED
Invalid Card4000000000000127DECLINEDINVALID_CARD_NUMBERDECLINED
CSC Mismatch4000000000000101DECLINEDCSC_VERIFICATION_FAILEDDECLINED
AVS Mismatch4000000000000010DECLINEDADDRESS_VERIFICATION_FAILEDDECLINED

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.

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

TIDDescription
SUCCESSApproves all card present transactions successfully after internal validation

Decline Terminals (card/issuer rejected the transaction)

ScenarioTIDResultError CodePayment Status
Generic DeclineTRANSACTION_DECLINEDDECLINEDTRANSACTION_DECLINEDDECLINED
Card ExpiredCARD_EXPIREDDECLINEDCARD_EXPIREDDECLINED
Debit Requires PINDEBIT_REQUIRES_PINDECLINEDDEBIT_REQUIRES_PINDECLINED
EULA DisagreedEULA_DISAGREEDDECLINEDEULA_DISAGREEDDECLINED

Terminal Interaction Errors (device-level issues)

ScenarioTIDResultError CodePayment Status
Customer AbortedCARD_PRESENT_ABORTEDFAILURECARD_PRESENT_ABORTEDABORTED
Terminal TimeoutCARD_PRESENT_TIMEOUTFAILURECARD_PRESENT_TIMEOUTABORTED
No Processor ResponseCARD_PRESENT_NO_RESPONSEFAILURECARD_PRESENT_NO_RESPONSEFAILED
Remove CardCARD_PRESENT_REMOVE_CARDFAILURECARD_PRESENT_REMOVE_CARDFAILED
Duplicate TransactionCARD_PRESENT_DUPLICATEFAILURECARD_PRESENT_DUPLICATEFAILED
Cannot ConnectCARD_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.