if ($input['trxn_id']) {
$input['is_test'] = 0;
}
- else {
+ // Only assume trxn_id 'should' have been returned for success.
+ // Per CRM-17611 it would also not be passed back for a decline.
+ elseif ($input['response_code'] == 1) {
$input['is_test'] = 1;
$input['trxn_id'] = md5(uniqid(rand(), TRUE));
}
* @throws CRM_Core_Exception
*/
public function checkMD5($paymentObject, $input) {
+ if (empty($input['trxn_id'])) {
+ // For decline we have nothing to check against.
+ return;
+ }
if (!$paymentObject->checkMD5($input['MD5_Hash'], $input['trxn_id'], $input['amount'], TRUE)) {
$message = "Failure: Security verification failed";
$log = new CRM_Utils_SystemLogger();