Guest Posted March 6, 2008 Share Posted March 6, 2008 I need some very important help. Our host has upgraded to PHP 5.1 something. This version of php does not come with Mhas, but just "hash". The only affected part of our 3.17 store is the authorize.net SIM transfer.inc.php page. Can someone tell me how to convert the Mhash call to has? Our store is broken until then. I'm guessing the part that needs changing is this (or more) // compute HMAC-MD5 // Uses PHP mhash extension. Pl sure to enable the extension function hmac ($key, $data) { return (bin2hex (mhash(MHASH_MD5, $data, $key))); } // Calculate and return fingerprint // Use when you need control on the HTML output function CalculateFP ($loginid, $txnkey, $amount, $sequence, $tstamp, $currency = "") { return (hmac ($txnkey, $loginid . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $currency)); } Quote Link to comment Share on other sites More sharing options...
Guest Peterson Panel Posted March 6, 2008 Share Posted March 6, 2008 I need some very important help. Our host has upgraded to PHP 5.1 something. This version of php does not come with Mhas, but just "hash". The only affected part of our 3.17 store is the authorize.net SIM transfer.inc.php page. Can someone tell me how to convert the Mhash call to has? Our store is broken until then. I'm guessing the part that needs changing is this (or more) // compute HMAC-MD5 // Uses PHP mhash extension. Pl sure to enable the extension function hmac ($key, $data) { return (bin2hex (mhash(MHASH_MD5, $data, $key))); } // Calculate and return fingerprint // Use when you need control on the HTML output function CalculateFP ($loginid, $txnkey, $amount, $sequence, $tstamp, $currency = "") { return (hmac ($txnkey, $loginid . "^" . $sequence . "^" . $tstamp . "^" . $amount . "^" . $currency)); } "Mhash" is available in PHP5. http://us2.php.net/manual/en/function.mhash.php It's likely your host forgot to enable this extension when they upgraded. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 10, 2008 Share Posted March 10, 2008 Maybe, maybe not. http://us3.php.net/mhash says it was dropped as of PHP 5.3.0 But if Websurfer's host told him PHP 5.1.x, then it should still be there. I do not know what the differences in the documentation between: http://us3.php.net/mhash and http://us3.php.net/manual/en/function.mhash.php I guess http://us3.php.net/mhash is an introductory overview of the whole mhash() library while http://us3.php.net/manual/en/function.mhash.php describes the core function itself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.