Commit 354bc8a9 authored by francescbassas's avatar francescbassas
Browse files
parent 53b0171c
......@@ -265,8 +265,7 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
$ipn->getInput($input, $ids);
CRM_Core_Error::debug_log_message("Redsys IPN Response: Parameteres received \n input: " . print_r($input, TRUE) . "\n ids: " . print_r($ids, TRUE));
$paymentProcessorID = $this->_paymentProcessor['id'];
if (!$ipn->validateData($this->_paymentProcessor, $input, $ids, $objects, TRUE, $paymentProcessorID)) {
if (!$ipn->validateData($input, $ids, $objects, TRUE, $this->_paymentProcessor['id'])) {
CRM_Core_Error::debug_log_message("Redsys Validation failed");
return FALSE;
}
......
......@@ -137,10 +137,12 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN {
}
}
function validateData($paymentProcessor, &$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) {
$signatureNotif = $this->_redsysAPI->createMerchantSignatureNotif($paymentProcessor["password"], $input["Ds_MerchantParameters"]);
function validateData(&$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) {
$success = parent::validateData($input, $ids, $objects, $required, $paymentProcessorID);
if ($input['Ds_MerchantCode'] != $paymentProcessor["user_name"]) {
$signatureNotif = $this->_redsysAPI->createMerchantSignatureNotif($objects['paymentProcessor']["password"], $input["Ds_MerchantParameters"]);
if ($input['Ds_MerchantCode'] != $objects['paymentProcessor']["user_name"]) {
CRM_Core_Error::debug_log_message("Redsys Response param Ds_MerchantCode incorrect");
return FALSE;
}
......@@ -150,7 +152,7 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN {
return FALSE;
}
return parent::validateData($input, $ids, $objects, $required, $paymentProcessorID);
return $success;
}
static function retrieve($name, $type, $location = 'POST', $abort = TRUE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment