Skip to content

Commit 575603d

Browse files
committed
Merge #160 to future branch
2 parents 59ece26 + 73cdbab commit 575603d

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

lib/AuthorizeNetSIM.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,23 @@ public function getHiddenFieldString()
197197
/**
198198
* Generates a fingerprint needed for a hosted order form or DPM.
199199
*
200-
* @param string $api_login_id Login ID.
201-
* @param string $transaction_key API key.
202-
* @param string $amount Amount of transaction.
203-
* @param string $fp_sequence An invoice number or random number.
204-
* @param string $fp_timestamp Timestamp.
200+
* @param string $api_login_id Login ID.
201+
* @param string $transaction_key API key.
202+
* @param string $amount Amount of transaction.
203+
* @param string $fp_sequence An invoice number or random number.
204+
* @param string $fp_timestamp Timestamp.
205+
* @param string $fp_currency_code Currency Code
205206
*
206207
* @return string The fingerprint.
207208
*/
208-
public static function getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $fp_timestamp)
209+
public static function getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $fp_timestamp, $fp_currency_code = '')
209210
{
210211
$api_login_id = ($api_login_id ? $api_login_id : (defined('AUTHORIZENET_API_LOGIN_ID') ? AUTHORIZENET_API_LOGIN_ID : ""));
211212
$transaction_key = ($transaction_key ? $transaction_key : (defined('AUTHORIZENET_TRANSACTION_KEY') ? AUTHORIZENET_TRANSACTION_KEY : ""));
212213
if (function_exists('hash_hmac')) {
213-
return hash_hmac("md5", $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^", $transaction_key);
214+
return hash_hmac("md5", $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^" . $fp_currency_code, $transaction_key);
214215
}
215-
return bin2hex(mhash(MHASH_MD5, $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^", $transaction_key));
216+
return bin2hex(mhash(MHASH_MD5, $api_login_id . "^" . $fp_sequence . "^" . $fp_timestamp . "^" . $amount . "^" . $fp_currency_code, $transaction_key));
216217
}
217218

218219
}

0 commit comments

Comments
 (0)