cancel
Showing results for 
Search instead for 
Did you mean: 

Confused: Does test against production mean use true or false with SANDBOX and TEST_REQUEST

I'm confused by the whole "test against production" phrase in the SDK's config.php file. I cannot tell whether to use true or false with AUTHORIZENET_SANDBOX and TEST_REQUEST. I'm doing an AIM with php.

 

I am creating an online payment page that collects name, credit card, street, zip, expiration date, and other payment details (eg, invoice num, customer num, and the like). I want to test it using the test account I created. I have put my test account AUTHORIZENET_API_LOGIN_ID and AUTHORIZENET_TRANSACTION_KEY into config.php.

 

I limited the Visa card numbers to 16 digits, since various sources said they no longer do 13 digits. So I cannot use the Visa Test Card number in the SDK's readme file (because it has only 13 digits; my form will refuse to accept it). I have tried some of the other numbers, and am getting "generic error" messages. In other words, the transactions are neither accepted nor declined. The error message varies according to which card number I use, possibly also which CVV number I put. (I've been putting a random 0xy into that field.)

 

It would help me greatly to know whether I should use true or false in those two fields (mentioned at the top of this post) when I am testing my form, and then when I go live. I don't see anywhere in the sample code where there is a url for testing versus live for me to change. I'm assuming that is handled by the SDK.

 

While I'm reasonably conversant with PHP, this is my first serious foray into ecommerce and gateways and the like. I would appreciate any light you can shed on this whole testing environment thing.

snowyn
Member
2 REPLIES 2

If using a test account:
Set SANDBOX to true
Set TEST_REQUEST to false (or not setting it might work as well, I never used it on my test account)

If using the mechant account and testing:
Set SANDBOX to false
Set TEST_REQUEST to true or log into the account and turn test mode on (I used test mode)

If you want to process live transactions:
Set SANDBOX to false
Make sure test mode is off and either set TEST_REQUEST to false or don't define it

 

Personally, rather than mess with the config, I just set everything on the script end of things. For instance, if I'm doing an AIM transaction on my test account:

 

$authorize = new AuthorizeNetAIM($myid, $mykey);
$authorize->setSandbox(true);

or:

define("AUTHORIZENET_SANDBOX", true);

 

I would assume you can set TEST_REQUEST in a similar manner.

 

TJPride
Expert

Awesome -- thanks! This is totally clear.