03-27-2012 07:03 PM
Opencart 188.8.131.52, fresh install, browser cleared, full SSL with curl. I've posted this in the OpenCart forum too.
I'm having a nightmare getting Authorize.net AIM module to work. I have a valid sandbox account with Authorize.net 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.
CURL INIT URL:
CART VIA AIM TO GATEWAY:
BACK FROM ANET:
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,firstname.lastname@example.org,SuperUltralightBackpacking.com,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!
03-28-2012 12:13 AM
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?
03-28-2012 09:42 AM
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.
03-28-2012 11:14 AM
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.