cancel
Showing results for 
Search instead for 
Did you mean: 

Authorize.net Gateway Errors without Message

SOLVED

Authorize.net Gateway Errors without Message

A few of our clients have reported customers unable to complete purchases via Authorize.net. The form submit on the checkout page returns a 500 response and the server is receiving the RESPONSE_CODE_ERROR (3) response code.

 

All installs are Magento 1, 1.8x to 1.9.x

 

Is this an issue for anyone else at the moment?

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Authorize.net Gateway Errors without Message

Hi Everyone,

 

We just released an emergency fix to several client sites.  The delimitating character that Authorize.net was using changed to a "(".  As a quick/temporary fix we changed the 

const RESPONSE_DELIM_CHAR

in  the following class (app/code/core/Mage/Paygate/Model/Authorize.netphp)

Mage_Paygate_Model_Authorizenet

from 

'(~)'

 to 

'('

 

 

I hope this helps as a temporary solution.  If Magento doesn't release an official fix we'll package this as a proper override.

 

View solution in original post

Re: Authorize.net Gateway Errors without Message

8:34pm ET - I spoke to Authorize.net and they confirmed (finally!) that they are going to roll this change back. As to whether or not you want to implement this patch, it is up to you. Zoey plans on keeping this patch in its codebase as it provides no downsides and more accurately follows the implementation documentation from Authorize.net which does state that the delimiter and encapsulation variable should only be 1 character.

 

Hello,

 

Authorize.net made an unannounced change in their support of the delimiter character from any string to only one character. The fix provided above is incomplete and will cause errors because parsing the delimited on ( means that any user input containing ( will also break.

 

Here is a more complete fix, although the most proper fix is for Authorize.net to revert this change in my opinion.

 

//Remove
const RESPONSE_DELIM_CHAR = '(~)'; //Add
const RESPONSE_DELIM_CHAR = '~'; const RESPONSE_ENCAP_CHAR = '|';

 

// Add these lines above $client->setParameterPost($request->getData()); about line #1285
$request->setXDelimChar(self::RESPONSE_DELIM_CHAR);
$request->setXEncapChar(self::RESPONSE_ENCAP_CHAR);

 

//Remove this line
$r = explode(self::RESPONSE_DELIM_CHAR, $responseBody);

//Replace with
$r = explode(self::RESPONSE_ENCAP_CHAR . self::RESPONSE_DELIM_CHAR . self::RESPONSE_ENCAP_CHAR, $responseBody);

if(isset($r[0]) && $r[0]{0} === self::RESPONSE_ENCAP_CHAR) {
   $r[0] = substr($r[0], 1);
}

$rCount = count($r);

if(strpos($r[($rCount-1)], self::RESPONSE_ENCAP_CHAR) !== false) {
    $r[($rCount-1)] = str_replace(self::RESPONSE_ENCAP_CHAR, '', $r[($rCount-1)]);
}



We are unaffiliated with Magento and this fix is hopefully able to help others.

 

Uri

Zoey

www.zoey.com

View solution in original post

23 REPLIES 23

Re: Authorize.net Gateway Errors without Message

It is happening to one of my clients.

We enabled logging and it looks like the response getting returned is incomplete or something else is going on.

 

I have been on the phone with an Authorize.net rep and they are stating that they have been a lot of calls with Magento and that it is something wrong with Magento's handling of the "fingerprint". 

 

As nothing has changed in the codebase this seems odd.

 

[result] => Array
(
[response_code] => 1
[response_subcode] => 0
[response_reason_code] => 0
[response_reason_text] =>
[approval_code] =>
[avs_result_code] =>
[transaction_id] =>
[invoice_number] =>
[description] =>
[amount] =>
[method] =>
[transaction_type] =>
[customer_id] =>
[md5_hash] =>
[card_code_response_code] =>
[c_av_vresponse_code] =>
[split_tender_id] =>
[acc_number] =>
[card_type] =>
[requested_amount] =>
[balance_on_card] =>
)

Re: Authorize.net Gateway Errors without Message

Same here, both our magento sites are broke with authorize.net - just got off the phone with auth.net and they claim magento is working on a fix.  Seems odd considering we haven't done any patches or software updates recently.

Re: Authorize.net Gateway Errors without Message

LOL that is the same response that I got. Sounds a bit of a just say this from support manager.

"Magento" is working on a fix.

I am debugging the response body and looking at system logs.

It would appear that the response has been changed somehow and it is not being parsed into an array correctly.

A bunch of illegal offset errors related tot he response body.

 

 

 

Re: Authorize.net Gateway Errors without Message

I, too, all the sudden experienced exact same Authnet errors. It happened about NOON pacific time (January 22). I have not implemented any change on my Magento 1.9 website, nor with Authorizenet module. 

I was with Authorizenet tech support about 2 PM PST and they informed me that specifically Magento clients are experiencing this error. So they are reporting a high amount of customers complaining about this. 

Clearly an issue is going on. 
-------------------

I was also checking the log files for my server, and I got several errors I will post below. Not sure if it is related. But if it is, perhaps it will help someone. Here it is:

[22-Jan-2019 21:01:53 UTC] PHP Fatal error: Call to a member function setMessage() on a non-object in /www/sites/www.<mysite>.com/files/html/app/code/core/Mage/Paygate/Model/Authorizenet.php on line 1449

[22-Jan-2019 21:42:02 UTC] PHP Fatal error: Call to a member function setMessage() on a non-object in /www/sites/www.<mysite>.com/files/html/app/code/core/Mage/Paygate/Model/Authorizenet.php on line 1449

[22-Jan-2019 21:55:16 UTC] PHP Fatal error: Call to a member function setMessage() on a non-object in /www/sites/www.<mysite>.com/files/html/app/code/core/Mage/Paygate/Model/Authorizenet.php on line 1449

Re: Authorize.net Gateway Errors without Message

Hi Everyone,

 

We just released an emergency fix to several client sites.  The delimitating character that Authorize.net was using changed to a "(".  As a quick/temporary fix we changed the 

const RESPONSE_DELIM_CHAR

in  the following class (app/code/core/Mage/Paygate/Model/Authorize.netphp)

Mage_Paygate_Model_Authorizenet

from 

'(~)'

 to 

'('

 

 

I hope this helps as a temporary solution.  If Magento doesn't release an official fix we'll package this as a proper override.

 

Re: Authorize.net Gateway Errors without Message

I am experiencing the same problems & got the same response from authorize.net. I asked their customer service rep to email a summary of this conversation so I could have it on file, so when it is determined to be authorize.net, I have some fire power to use against them, but of course they have now way to do that.

I wonder if it in any way has anything to do with this - https://community.developer.authorize.net/t5/News-and-Announcements/Changes-to-Supported-Characters-...

Re: Authorize.net Gateway Errors without Message

I was just testing this same fix but my concern in applying it is if Authnet changes their response again and now we have it broken in reverse.

 

 

Re: Authorize.net Gateway Errors without Message

I can confirm that the fix that @AbleCanyon posted does indeed work.

Re: Authorize.net Gateway Errors without Message

Yes. About 1 pm CT our Auth.net gateway started showing errors. When a customer would hit the submit button to place an order, the order would get passed through to Auth.net and was charges, showing an order #, but not passed back to our order system. Auth.net told me the same thing that there was a change on the Magento side and that "they" were working on it. 

I had not made any configuration changes or updates to the site, and all was working well until then. Thankfully, we caught it and was able to switch processing systems for the moment so we were not loosing sales. Other payment options, such as purchase by check or PO seem to be working fine. I agree that this was on Auth.net's end.