Skip to main content

Payments Testing

Test Cards

Use the following card numbers for testing in sandbox.

These card numbers are not valid and will not work in production.

Card TypeTest Card NumberExpiration Date
Visa4111 1111 1111 1111any future date
Mastercard5500 0000 0000 0004any future date
Mastercard2223 0001 4840 0010any future date
AMEX3400 0000 0000 009any future date
Discover6011 0000 0000 0004any future date

Note: AMEX test card is 15 digits

Declines & Error Responses

There are a number of ways in which your payment request could fail:

  • fails basic API validation
  • rejected/failed internally to Exact Payments Gateway
  • rejected/failed by your processor

API Failures

These are straightforward and will result in a status code of 400 and a response payload describing the error. You can generate these by sending invalid values for any attributes. For example, all amounts in our APIs are expected to be in cents, so submitting an amount of 50.12 will be rejected with a payload of...

{
"messages": [
"Amount must be an integer"
]
}

Gateway Failures

Gateway failures are simulated by submitting payments with specific amounts, where the desired response code is added to $5000.00. For example, submitting a test transaction with an amount of 500022 returns a response of "Invalid Credit Card Number".

{
"messages": [
"Invalid Credit Card Number"
]
}

The following amounts can be used to generate the corresponding error message (please convert to cents in the API payload):

AmountError MessageDetails
$5000.22Invalid Credit Card Number
$5000.25Invalid Expiry Date
$5000.26Invalid Amount
$5000.27Invalid Card Holder
$5000.28Invalid Authorization Number
$5000.37Payment Type Not Supported by MerchantTried to accept payment using a method not enabled for your account
$5000.57Invalid Reference No - Blank invoice number
$5000.58Invalid AVS String
$5000.60Invalid Customer Reference No

In some cases, a payment fails after we have started processing, and as a result there will be a failed transaction recorded in our database. When this happens, the response contains the payment details and will also include an exactResponse element with a failure code and message. For example, submitting an amount of 500044 will return a payment response which includes

"exactResponse": {
"code": "44",
"message": "Address not Verified"
}

The following amounts can be used to generate the corresponding error message (please convert to cents in the API payload):

AmountExact Response CodeStatusDetails
$5000.0808CVV2/CID/CVC2 Data not VerifiedThe CVD code received from the processor matched one of your CVV filters. Payment was voided
$5000.0909Transaction Reversed
$5000.1212Message Timed-out at HostWe timed-out while trying to contact the processor
$5000.4444Address not VerifiedThe AVS code received from the processor matched one of your AVS filters. Payment was voided
$5000.6161Internal Network ErrorA network connection failed during processing
$5000.9595Invalid Currency RequestedYou tried to process in a currency which is not enabled for your account

Processor Failures

Gateway failures are simulated by submitting payments with specific whole-dollar amounts, as follows:

amountResponse CodeReason
$5000 - $5099NDDecline (Hard or Soft)
$5100 - $5199AAApproved
$5200NCDecline (Pick up card)
$5201NDDecline (Hard or Soft)
$5202NFDecline (Record Not Found)
$5203NRDecline (Referral Message)
$5204N7Decline (For CVV2 Only)
$5205 - $5999NDDecline (Hard or Soft)

All amounts in our APIs are in cents, so, for example, if you wanted to generate an "NR" bank response code, then you would submit an amount of 520300. The above codes also need to be whole dollar amounts, so 520301 will not work as it is not a whole dollar amount.

{
...
"sent_to_bank": true,
"bank_response": {
"code": "ND",
"message": "Declined"
},
...
}