Recently my site started giving errors at checkout, now I am realizing that it might be the fact that I am using MD5. Below is my current code, can anyone give me some direction? I have read the authorize.net upgrade info but still am unsure. Here is the code I am currently passing my $loginid and $txnkey. Thank you for any help with this!
// Main Interfaces: // // function InsertFP ($loginid, $txnkey, $amount, $sequence) - Insert HTML form elements required for SIM // function CalculateFP ($loginid, $txnkey, $amount, $sequence, $tstamp) - Returns Fingerprint. // 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); echo ('<input type="hidden" name="x_fp_sequence" value="' . $sequence . '">' ); echo ('<input type="hidden" name="x_fp_timestamp" value="' . $tstamp . '">' ); echo ('<input type="hidden" name="x_fp_hash" value="' . $fingerprint . '">' ); echo "\n<input type='hidden' name='x_login' value='$loginid'>\n"; return (0); }
03-27-2019 08:32 AM
03-27-2019 09:47 AM