cancel
Showing results for 
Search instead for 
Did you mean: 

AIM not working (PHP SDK Sample in WAMP)

I've just started using Authorize.net for the first time, so I downloaded the PHP sample code and hosted it on a local server (WAMP). I added my API Login and Transaction Key to config.php (I'm positive they're correct). However, when I click "Buy" on checkout_form.php, I'm taken to https://test.authorize.net/gateway/transact.dll where I receive the following error:

 

3,2,13,The merchant login ID or password is invalid or the account is inactive.,,P,0,,,2.18,,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,9F76D49A5960CCB8226C471FBB9C8277,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

*I'm using AIM

*My login ID (api login ID?) and password (transaction key?) are correct.

*My account is in Test mode

*The only file I have modified from the PHP sample is config.php:

<?php
/**
 * This file contains config info for the sample app.
 */

// Adjust this to point to the Authorize.Net PHP SDK
require_once 'anet_php_sdk/AuthorizeNet.php';


$METHOD_TO_USE = "AIM";
//$METHOD_TO_USE = "DIRECT_POST";         // Uncomment this line to test DPM


define("AUTHORIZENET_API_LOGIN_ID","MYLOGINID");    // Add your API LOGIN ID
define("AUTHORIZENET_TRANSACTION_KEY","MYTRANSACTIONKEY"); // Add your API transaction key
define("AUTHORIZENET_SANDBOX",true);       // Set to false to test against production
define("TEST_REQUEST", "FALSE");           // You may want to set to true if testing against production


// You only need to adjust the two variables below if testing DPM
define("AUTHORIZENET_MD5_SETTING","");                // Add your MD5 Setting.
$site_root = "http://YOURDOMAIN/samples/your_store/"; // Add the URL to your site


if (AUTHORIZENET_API_LOGIN_ID == "") {
    die('Enter your merchant credentials in config.php before running the sample app.');
}

After a few forum/Google searches, I'm still at a complete loss. I noticed the error mentions having an inactive account, but as far as I can tell, my account is activated. Any ideas?

js2393
Member
1 ACCEPTED SOLUTION

Accepted Solutions

UPDATE: So, apparently I was making a newbie mistake. I was using the API Login and Transaction Key for a non-test/developer account. I wasn't aware that I needed to have two completely separate accounts. In case anyone else encounters this error, be sure to also have an account at test.authorize.net and use the API Login and Transaction Key from that account for testing.

 

However, I still don't completely understand how this works. Both my authorize.net and test.authorize.net accounts have a "Test" and "Live" mode. When should I use "Live" mode at test.authorize.net, and when should I use "Test" mode at authorize.net?

View solution in original post

js2393
Member
6 REPLIES 6

UPDATE: So, apparently I was making a newbie mistake. I was using the API Login and Transaction Key for a non-test/developer account. I wasn't aware that I needed to have two completely separate accounts. In case anyone else encounters this error, be sure to also have an account at test.authorize.net and use the API Login and Transaction Key from that account for testing.

 

However, I still don't completely understand how this works. Both my authorize.net and test.authorize.net accounts have a "Test" and "Live" mode. When should I use "Live" mode at test.authorize.net, and when should I use "Test" mode at authorize.net?

js2393
Member

Thanks, that was very helpful.

 

However, I now have another issue:

 

I'm using DTM now instead of AIM. Once again, I'm only using the sample code, and I haven't changed anything except for config.php (commented out AIM, uncommented DTM, set the hash (same as what I set on my developers/test account.) However, instead of the relay response fails as I'm given the error:

 

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card. 

      This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.

 Looking through the forums, this seems to be a very common error, but as I said before, I haven't changed anything in the sample code so I don't understand why it isn't working. I don't receive any errors when I go directly to the process_sale.php page (this is set as the relay url in the sample).

Lucky for you, Michelle have another one

Relay Response Basics and Troubleshooting

You will need to set the relay response URL in the merchant account. And it have to be an URL that can be access publicly.

Live Production account at https://secure.authorize.net/

Test site account at https://test.authorize.net/

Sorry for the double post, but I am unable to edit my previous reply.

 

I believe the issue is that I'm trying to test locally, because obviously, the relay doesn't know how to reach "localhost/samples/.....". Is there a way to test Authorize.net DPM locally on a WAMP setup? I get the impression this is not possible with DPM (it is with AIM, but I need to use DPM for other reasons.)

 

EDIT: Not sure why I keep using DTM. Meant to use DPM*

You could, it basically just a curl post to the relay response page, you can see the post response in here.  But, you will be better off testing it in the setting close to the production site, other have issue with their hosting, timeout and other problem.