Below is a portion of code required by authorize.net (an online ecommerce processing center)...
// 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));
}
// Inserts the hidden variables in the HTML FORM required for SIM
// Invokes hmac function to calculate fingerprint.
function InsertFP ($loginid, $txnkey, $amount, $sequence, $currency = "")
{
$tstamp = time ();
$fingerprint = hmac ($txnkey, $loginid . "" . $sequence . "" . $tstamp . "" . $amount . "" . $currency);
As "mhash" is not installed by the server providor, can I just use the internal Md5 functionality with PHP4 instead, or will this yield a different alogoryth entirely?
And on that note, I have a dumb question...what are the "." for in the various strings above, is that basically a concatonation operator?
Thanks kindly, espeically in regards to the newbie "." question