Testing Environment
How to test payments before going live in production.
Before your merchant account is verified, you will be able to test the API in our sandbox environment. No actual transactions will be processed.
You'll need to use some specific data to be able to simulate successful payments, declines and various errors that might occur once your account is verified, and you are live.
Environment Header
You can set the CARTGATEWAY-ENVIRONMENT
to sandbox
to process requests in our sandbox environment. If you are using the PHP SDK, you should set the sandbox
property when creating a new CartGateway client:
$client = new CartGateway([
'environment' => 'sandbox',
'account_id' => Config::TEST_ACCOUNT_ID,
'access_token' => Config::TEST_ACCESS_TOKEN,
]);
Test Address
Use the following address details in the sandbox environment:
Description | Parameter | Value |
---|---|---|
Address | address | 6 Pheasant Run |
Zip Code | zip | 07733 |
City | city | Holmdel |
State | state | NJ |
Country | country | United States |
If you use a different address, you will receive a AVS error.
Test Cards
You can use special test card numbers in the sandbox environment to test various scenarios and make sure that you can handle both successful transactions, declined transactions, and errors.
To simulate a successful transaction, you can use the following card details:
Card Number: 6011111111111117
Date: Any Date in the future
CVV: 123
If you use an incorrect date, you will receive a validation error. If you use a CVV other than 123
, you will receive a CVV error.
To simulate a failed transaction/decline, you can use one of the following card details:
Card Number | Failure |
---|---|
4000000000000002 | Generic Decline |
4000000000009995 | Insufficient funds decline |
4000000000009987 | Lost card decline |
4000000000009979 | Stolen card decline |
4000000000000069 | Expired card decline |
4000000000000127 | Incorrect CVV decline |
4000000000000119 | Processing error decline |
4242424242424241 | Incorrect number decline |
Updated about 2 months ago