Integration and Testing

Authorize.Net API questions and help with your payment integration.

Posts: 3
Registered: ‎03-27-2012

AIM 103 Trans Key ERROR, with LIVE and Sandbox Gateways

Opencart, fresh install, browser cleared, full SSL with curl. I've posted this in the OpenCart forum too.

I'm having a nightmare getting AIM module to work. I have a valid sandbox account with and correct login_id (it's not the username) and tran_key. Direct Response is set to YES in Gateway.

In OpenCart /catalog/controller/payment/authorizenet_aim.php I've added a log write snippet to see what Anet was getting and sending back.



3,1,103,This transaction cannot be accepted.,,P,0,,,0.00,,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,XXX,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,XXX,3.1,true,,,",false,John,Doe,,10 Dev Null St,Dev Null,California,90000,United States,8884445555,XXX,johndoe@dev.null,,6.44,USD,CC,AUTH_CAPTURE,4007000000027,042013,123,17

3 means processing error and 103 means tran_key no good, which is absolutely NOT the case. It's something else, I just can't figure it out. I've tried on my LIVE account (not sandbox, not test, and with my LIVE versions of login_id and tran_key) with a real CC and it did exactly the same.

Hopefully someone can help, because I'm sitting on new inventory that I need to move!

Posts: 1,609
Topics: 15
Kudos: 209
Solutions: 121
Registered: ‎06-23-2011

Re: AIM 103 Trans Key ERROR, with LIVE and Sandbox Gateways

Error 103 with AIM would be bad login ID or transaction key. You'd be surprised how many people mess those up and think they haven't. I even did that myself once. Did you try generating a new transaction key?

Posts: 3
Registered: ‎03-27-2012

Re: AIM 103 Trans Key ERROR, with LIVE and Sandbox Gateways

Hi TJ,


Thank you for the reply, but everything you mentioned was already covered in my post. I've heard that if you are using a domain name that hasn't AIM'd to the gateway before sometimes you have to reset the login_id as well? Do you think that  could be it?


Did you see anything in the query strings I posted that could be the issue?


As I mentioned, I has a live and sandbox acct and have fresh trans keys. Sorry, but I'm not that bad at copy pasting. Plus I have another domain that is AIMing just fine to my live gateway.

Posts: 3
Registered: ‎03-27-2012

SOLVED! Re: AIM 103 Trans Key ERROR, with LIVE and Sandbox Gateways

After 48 grueling hours of debugging, I found and resolved the issue.


The problem is LINE 103 in OPENCART:


curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));


Per PHP manual commenter:


You need to explicitly add the arg separater with http_build_query!


So to fix OpenCart's AIM all you need to do is change LINE 103 to:

curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data, '', '&'));


And you'll be good to go. I truly hope this helps someone, because it was a huge pain in the *&@ to figure out.