Jump to content

Converting Authorize SIM for PHP 5


Guest

Recommended Posts

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));

}

Link to comment
Share on other sites

Guest Peterson Panel

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...