/** * Constructor * * @param string $mode the mode of operation: live or test * * @return void */ function __construct($mode, &$paymentProcessor) { parent::__construct($mode, $paymentProcessor); }
/** * Check and validate gateway MD5 response if present. * * @param CRM_Core_Payment_AuthorizeNet $paymentObject * @param array $input * * @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(); $log->error('payment_notification', array('message' => $message, 'input' => $input)); throw new CRM_Core_Exception($message); } }
/** * Check and validate gateway MD5 response if present. * * @param CRM_Core_Payment_AuthorizeNet $paymentObject * @param array $input * * @return bool */ public function checkMD5($paymentObject, $input) { if (!$paymentObject->checkMD5($input['MD5_Hash'], $input['trxn_id'], $input['amount'], TRUE)) { CRM_Core_Error::debug_log_message("MD5 Verification failed."); echo "Failure: Security verification failed<p>"; exit; } return TRUE; }