Testing your code
Anchor provides a testing environment for the payment gateway and we require that users perform some initial testing before switching over to the live system.
To use the test gateway, replace this line:
require_once('anchor_ccard_live.php');
with
require_once('anchor_ccard_test.php');
You will also need to file a support request to get your test environment set up.
When testing your payment gateway code, it is important to check that your code will deal with any error code that the bank may return. When connected to the testing environment, you can use the amount to control which error code you will get back; when an amount more than $10.00 is specified, the 'cents' part of the amount will be returned as the response code. Note that this is a behavior specific to the testing environment. For example, if you were to specify the amount $0.33, the test environment would respond with a 33 response code, which corresponds to the 'EXPIRED CARD' error. The following table lists the error codes that you should test in this fashion:
Amount |
Response text |
10.13 |
INVALID AMOUNT |
10.00 |
APPROVED |
10.33 |
EXPIRED CARD |
You should test that your code behaves sensibly in all of these cases before accepting real payments.
