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 Type | Test Card Number | Expiration Date |
---|---|---|
Visa | 4111 1111 1111 1111 | any future date |
Mastercard | 5500 0000 0000 0004 | any future date |
Mastercard | 2223 0001 4840 0010 | any future date |
AMEX | 3400 0000 0000 009 | any future date |
Discover | 6011 0000 0000 0004 | any 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):
Amount | Error Message | Details |
---|---|---|
$5000.22 | Invalid Credit Card Number | |
$5000.25 | Invalid Expiry Date | |
$5000.26 | Invalid Amount | |
$5000.27 | Invalid Card Holder | |
$5000.28 | Invalid Authorization Number | |
$5000.37 | Payment Type Not Supported by Merchant | Tried to accept payment using a method not enabled for your account |
$5000.57 | Invalid Reference No - Blank invoice number | |
$5000.58 | Invalid AVS String | |
$5000.60 | Invalid 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):
Amount | Exact Response Code | Status | Details |
---|---|---|---|
$5000.08 | 08 | CVV2/CID/CVC2 Data not Verified | The CVD code received from the processor matched one of your CVV filters. Payment was voided |
$5000.09 | 09 | Transaction Reversed | |
$5000.12 | 12 | Message Timed-out at Host | We timed-out while trying to contact the processor |
$5000.44 | 44 | Address not Verified | The AVS code received from the processor matched one of your AVS filters. Payment was voided |
$5000.61 | 61 | Internal Network Error | A network connection failed during processing |
$5000.95 | 95 | Invalid Currency Requested | You 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:
amount | Response Code | Reason |
---|---|---|
$5000 - $5099 | ND | Decline (Hard or Soft) |
$5100 - $5199 | AA | Approved |
$5200 | NC | Decline (Pick up card) |
$5201 | ND | Decline (Hard or Soft) |
$5202 | NF | Decline (Record Not Found) |
$5203 | NR | Decline (Referral Message) |
$5204 | N7 | Decline (For CVV2 Only) |
$5205 - $5999 | ND | Decline (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"
},
...
}