OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: authorize.net error 97 - MD5 Hash installed
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Payment Modules > Other
mrthasewer
my client has md5 hash installed. The PHP code written seems to try to bypass that so you do not need it. If it is installed how do you get it to work (I do not have controll over the account). I have tried just commenting it out and then I get undefined functions. I am not much of a programmer so I am having difficulty with this. But I am gettin an error 97 from authorize.net that deals with the fingerprint. Any help with this would be greatly appreciated.

function hmac ($key, $data)
{
// RFC 2104 HMAC implementation for php.
// Creates an md5 HMAC.
// Eliminates the need to install mhash to compute a HMAC
// Hacked by Lance Rushing

$b = 64; // byte length for md5
if (strlen($key) > $b) {
$key = pack("H*",md5($key));
}
$key = str_pad($key, $b, chr(0x00));
$ipad = str_pad('', $b, chr(0x36));
$opad = str_pad('', $b, chr(0x5c));
$k_ipad = $key ^ $ipad ;
$k_opad = $key ^ $opad;

return md5($k_opad . pack("H*",md5($k_ipad . $data)));
}
// end code from lance (resume authorize.net code)
baude
mrthasewer

I was just on the phone with authorize.net regarding the code 97 error. What I was told was the only way this error can be generated is the is a time zone product between your server and authorize.net's.

Here's the email they sent me:
-----------------------------------------------------------------------------------------------
You will need to determine the difference between your server time and the Authorize.Net server time. Then you will need to set your script to subtract (or add) that time in seconds before the fingerprint is generated.

Perl
In the SimLib.pm file, replace the following line: my $tstamp = time; with this:
my $tstamp = time - (time difference in seconds); or my $tstamp = time + (time difference in seconds);

ASP
In the simlib.asp file, replace the following line: var tstamp = GetSecondsSince1970 ();

with this:
var tstamp = GetSecondsSince1970() - (time difference in seconds); or var tstamp = GetSecondsSince1970() + (time difference in seconds);

PHP
In the simlib.php file, replace the following line: $tstamp = time (); with this:
$tstamp = time () - (time difference in seconds); or $tstamp = time () + (time difference in seconds);
-----------------------------------------------------------------------------------------------
I put the php fix in and I still got the 97 error. Will be talking to them tomorrow.

Good luck!


QUOTE (mrthasewer @ Dec 4 2004, 09:41 AM)
my client has md5 hash installed. The PHP code written seems to try to bypass that so you do not need it. If it is installed how do you get it to work (I do not have controll over the account). I have tried just commenting it out and then I get undefined functions. I am not much of a programmer so I am having difficulty with this. But I am gettin an error 97 from authorize.net that deals with the fingerprint. Any help with this would be greatly appreciated.

function hmac ($key, $data)
{
  // RFC 2104 HMAC implementation for php.
  // Creates an md5 HMAC.
  // Eliminates the need to install mhash to compute a HMAC
  // Hacked by Lance Rushing

  $b = 64; // byte length for md5
  if (strlen($key) > $b) {
      $key = pack("H*",md5($key));
  }
  $key  = str_pad($key, $b, chr(0x00));
  $ipad = str_pad('', $b, chr(0x36));
  $opad = str_pad('', $b, chr(0x5c));
  $k_ipad = $key ^ $ipad ;
  $k_opad = $key ^ $opad;

  return md5($k_opad  . pack("H*",md5($k_ipad . $data)));
}
// end code from lance (resume authorize.net code)
*
mrthasewer
QUOTE (mrthasewer @ Dec 4 2004, 10:41 AM)
my client has md5 hash installed. The PHP code written seems to try to bypass that so you do not need it. If it is installed how do you get it to work (I do not have controll over the account). I have tried just commenting it out and then I get undefined functions. I am not much of a programmer so I am having difficulty with this. But I am gettin an error 97 from authorize.net that deals with the fingerprint. Any help with this would be greatly appreciated.

function hmac ($key, $data)
{
  // RFC 2104 HMAC implementation for php.
  // Creates an md5 HMAC.
  // Eliminates the need to install mhash to compute a HMAC
  // Hacked by Lance Rushing

  $b = 64; // byte length for md5
  if (strlen($key) > $b) {
      $key = pack("H*",md5($key));
  }
  $key  = str_pad($key, $b, chr(0x00));
  $ipad = str_pad('', $b, chr(0x36));
  $opad = str_pad('', $b, chr(0x5c));
  $k_ipad = $key ^ $ipad ;
  $k_opad = $key ^ $opad;

  return md5($k_opad  . pack("H*",md5($k_ipad . $data)));
}
// end code from lance (resume authorize.net code)
*
mrthasewer
I have a temporary solution it will work until May. find the tstamp variable and where it says tstamp = time you just add or subtract 3600. Just do not forget to change it when you leave or go into daylight savings.

I am working with my web host to help solve this long term. But if you are under deadline to get a site up. This will work.

Janalese
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.