Re: Authorize.net (SIM) payment method

sam353's picture
Offline
Joined: 08/12/2008
Juice: 48
Re: Authorize.net (SIM) payment method

Two problems I found implementing this module, that I was able to fix.

line 300 users hash_hmac which is only in php 5. If you're running php4 you can add this function

function hmac ($key, $data){
return (bin2hex (mhash(MHASH_MD5, $data, $key)));
}

and then use $fingerprint = hmac($txn_key, $login . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $ccode);

instead of $fingerprint = hash_hmac('md5', $login . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $ccode, $txn_key);

Second problem is that the amount wasn't formatted correctly so authnet was rejecting it, so to fix that underneath
$amount = $order->order_total;
I added:

$amount = uc_currency_format($amount, FALSE, FALSE, '.');

Authorize.net (SIM) payment method By: Tanjerine (72 replies) Fri, 06/06/2008 - 08:14