cancel
Showing results for 
Search instead for 
Did you mean: 

Working with test # in AIM sandbox, test address and CVC2?

I'm still working in sandbox mode. I have the test Visa and MC numbers and expiration, but what about testing for address verification and CVC2 verification? What data should I send to those variables?

 

While we're on the subject, I couldn't find any real info on the variables to send in the Docs, but I found this on Google. Is this still correct (assuming that it ever was)?

 

$transaction = new AuthorizeNetAIM('ID', 'KEY');

$transaction->setSandbox(true);

 

$transaction->amount = '9.99';

$transaction->card_num = '4007000000027';

$transaction->exp_date = '10/16';

 

$transaction->first_name = $cardholder_first_name;

$transaction->last_name => $cardholder_last_name;

$transaction->card_code => $cvc2;


$transaction->address => $billing_address;

$transaction->city => $billing_city;

$transaction->state => $billing_state;

$transaction->zip => $billing_zip;


$response = $transaction->authorizeAndCapture();

jwcarlton
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

Please make sure that your sandbox account is in live mode.  Transactions run in test mode (on either a test or production account) are only very basic simulations and approve pretty much everything.  Your test account needs to be in live mode for a more complete simulation that will recognize these triggers.

View solution in original post

10 REPLIES 10

I always just put in my own credit card info with card code 900 (your own card code won't work in sandbox). Don't know about address testing, I just turned it on and trusted that it would work correctly. Since I output the error text, I don't need to have every specific error coded for in advance, just success or failure.

 

Don't know if this helps.

TJPride
Expert

Hi jwcarlton,

 

Error Generation Guide lists values you can use to trigger certain transaction responses when using your test account. You can check the guide here: http://www.authorize.net/files/ErrorGenerationGuide.pdf

 

Thanks!

-Joy

 

 

Joy
Administrator Administrator
Administrator

Joy, I tried using the codes in the PDF you posted, but it's either not working correctly, or I'm totally misunderstanding the seemingly simple instructions.

 

Did I understand correctly that I should just use, for example, a zip code of 46282 while in the Sandbox, and it will automatically give me an error message that the charge is declined? When I did that, both $response->approved and $response->error_message came back as false (so it didn't charge, but it didn't give me an error message that I could pass along to the customer, either).

 

Further, when I changed the zip to 46201, I expected the charge to decline with an error that the address matched, but the zip didn't. But instead, the transaction was approved, anyway.

 

Similarly, when I changed the CVC2 to 901, I expected it to decline with an error that the CVC2 didn't match, but the transaction was still approved.

 

Where am I messing up?

Please make sure that your sandbox account is in live mode.  Transactions run in test mode (on either a test or production account) are only very basic simulations and approve pretty much everything.  Your test account needs to be in live mode for a more complete simulation that will recognize these triggers.

I actually clicked on "Accept as Solution" by accident; I mean to click Reply. I don't see a way to undo that.

 

Trevor, do you mean to just change $transaction->setSandbox(true); to false, and use the test credit card info? If not, then I'm not sure how to do what you said.

Looks like that's what he said. Should only take you a couple minutes to test and find out.

No way to get it work with any combinations with zip codes, only dollar amounts. Does anyone have a working example with zip code trigger that you can post here?

Did you use cc# 4222222222222 ?

Yes, tried everything yet still always get approved avs=Y, card code response='', cavv response =2