From f8a76a201ac5488833c9593be8dd69edcec80582 Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 17 Feb 2021 16:42:45 +0000 Subject: [PATCH 1/7] Add the new 'Payment Processor Type' to generate a token --- CRM/Core/Payment/Redsys.php | 40 +++++++++++++++++++++------------- CRM/Redsys/Upgrader.php | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/CRM/Core/Payment/Redsys.php b/CRM/Core/Payment/Redsys.php index 2706844..6f904cc 100644 --- a/CRM/Core/Payment/Redsys.php +++ b/CRM/Core/Payment/Redsys.php @@ -223,21 +223,31 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment { } $miObj = new RedsysAPI(); - $miObj->setParameter("Ds_Merchant_Amount", (int) (round($params["amount"] * 100))); - $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); - $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); - $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); - $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); - $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); - $miObj->setParameter("Ds_Merchant_MerchantURL", $merchantUrl); - $miObj->setParameter("Ds_Merchant_UrlOK", $returnURL); - $miObj->setParameter("Ds_Merchant_UrlKO", $cancelURL); - $miObj->setParameter("Ds_Merchant_ProductDescription", $description); - $miObj->setParameter("Ds_Merchant_Titular", $params["first_name"] . " " . $params["last_name"]); - $miObj->setParameter("Ds_Merchant_ConsumerLanguage", self::REDSYS_LANGUAGE_SPANISH); - - if (!empty($params["is_bizum"])) { - $miObj->setParameter("Ds_Merchant_PayMethods", 'z'); + if (empty($params["is_token"])) { + $miObj->setParameter("Ds_Merchant_Amount", (int) (round($params["amount"] * 100))); + $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); + $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); + $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); + $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); + $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); + $miObj->setParameter("Ds_Merchant_MerchantURL", $merchantUrl); + $miObj->setParameter("Ds_Merchant_UrlOK", $returnURL); + $miObj->setParameter("Ds_Merchant_UrlKO", $cancelURL); + $miObj->setParameter("Ds_Merchant_ProductDescription", $description); + $miObj->setParameter("Ds_Merchant_Titular", $params["first_name"] . " " . $params["last_name"]); + $miObj->setParameter("Ds_Merchant_ConsumerLanguage", self::REDSYS_LANGUAGE_SPANISH); + if (!empty($params["is_bizum"])) { + $miObj->setParameter("Ds_Merchant_PayMethods", 'z'); + } + } + else { + $miObj->setParameter("DS_MERCHANT_IDENTIFIER", 'REQUIRED'); + $miObj->setParameter("Ds_Merchant_Amount", 0); + $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); + $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); + $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); + $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); + $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); } $version = "HMAC_SHA256_V1"; diff --git a/CRM/Redsys/Upgrader.php b/CRM/Redsys/Upgrader.php index 13ec8bb..ca8fa70 100644 --- a/CRM/Redsys/Upgrader.php +++ b/CRM/Redsys/Upgrader.php @@ -79,6 +79,16 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { return TRUE; } + /** + * Add Tokenization/Recurring. + * + * @return void + */ + public function upgrade_4017() { + $this->addTokenPayment(); + return TRUE; + } + /** * Add build menu * @@ -171,4 +181,37 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { } } } + + /** + * Add Tokenization/Recurring Payment + * + * @return void + */ + private static function addTokenPayment() { + $resultPaymentMethod = civicrm_api3('PaymentProcessorType', 'get', [ + 'sequential' => 1, + 'name' => "Recurring Redsys", + ]); + if ($resultPaymentMethod["count"] == 0) { + $params = [ + 'name' => 'Recurring Redsys', + 'title' => 'Recurring Redsys Payment Processor', + 'description' => 'Works with Servired (Sermepa) and 4B (Pasat).', + 'class_name' => 'Payment_RedsysToken', + 'billing_mode' => 'notify', + 'user_name_label' => 'Número de comercio', + 'password_label' => 'Clave secreta de encriptación', + 'url_site_default' => 'https://sis.redsys.es/sis/realizarPago', + 'url_site_test_default' => 'https://sis-t.redsys.es:25443/sis/realizarPago', + 'is_recur' => 0, + 'payment_type' => 1, + ]; + civicrm_api3('PaymentProcessorType', 'create', $params); + } + else { + foreach ($resultPaymentMethod["values"] as $resultPaymentMethodValue) { + civicrm_api3('PaymentProcessorType', 'create', ["id" => $resultPaymentMethodValue["id"], 'is_active' => 1]); + } + } + } } -- GitLab From 5b505fc571d68593a7cc6594506ac9a4fa5df9b9 Mon Sep 17 00:00:00 2001 From: Ruben Date: Wed, 17 Feb 2021 16:43:04 +0000 Subject: [PATCH 2/7] Add the new 'Payment Processor Type' to generate a token --- CRM/Core/Payment/RedsysToken.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 CRM/Core/Payment/RedsysToken.php diff --git a/CRM/Core/Payment/RedsysToken.php b/CRM/Core/Payment/RedsysToken.php new file mode 100644 index 0000000..62fc62d --- /dev/null +++ b/CRM/Core/Payment/RedsysToken.php @@ -0,0 +1,15 @@ + Date: Fri, 19 Mar 2021 14:41:12 +0000 Subject: [PATCH 3/7] Redsys Tokenization - Add hook to save the token with another dev, refactor params to send --- CRM/Core/Payment/Redsys.php | 48 +++++++++++++------------- CRM/Core/Payment/RedsysIPN.php | 13 +++++++ CRM/Redsys/Form/Settings.php | 2 +- CRM/Redsys/Upgrader.php | 9 ++++- CRM/Utils/Hooks/Redsys.php | 17 +++++++++ templates/CRM/Redsys/Form/Settings.tpl | 4 +-- 6 files changed, 65 insertions(+), 28 deletions(-) create mode 100644 CRM/Utils/Hooks/Redsys.php diff --git a/CRM/Core/Payment/Redsys.php b/CRM/Core/Payment/Redsys.php index 6f904cc..f1fb157 100644 --- a/CRM/Core/Payment/Redsys.php +++ b/CRM/Core/Payment/Redsys.php @@ -168,8 +168,15 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment { } } + if (!empty($params["is_token"])) { + $processorName = "Redsys_Tokenization"; + } + else { + $processorName = "Redsys"; + } + $merchantUrl = CRM_Utils_System::url('civicrm/payment/ipn', - 'processor_name=Redsys&mode=' . $this->_mode . '&md=' . $component . '&qfKey=' . $params["qfKey"] . '&' . $merchantUrlParams, + "processor_name={$processorName}&mode={$this->_mode}&md={$component}&qfKey={$params['qfKey']}&{$merchantUrlParams}", TRUE, NULL, FALSE, TRUE ); @@ -223,31 +230,24 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment { } $miObj = new RedsysAPI(); - if (empty($params["is_token"])) { - $miObj->setParameter("Ds_Merchant_Amount", (int) (round($params["amount"] * 100))); - $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); - $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); - $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); - $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); - $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); - $miObj->setParameter("Ds_Merchant_MerchantURL", $merchantUrl); - $miObj->setParameter("Ds_Merchant_UrlOK", $returnURL); - $miObj->setParameter("Ds_Merchant_UrlKO", $cancelURL); - $miObj->setParameter("Ds_Merchant_ProductDescription", $description); - $miObj->setParameter("Ds_Merchant_Titular", $params["first_name"] . " " . $params["last_name"]); - $miObj->setParameter("Ds_Merchant_ConsumerLanguage", self::REDSYS_LANGUAGE_SPANISH); - if (!empty($params["is_bizum"])) { - $miObj->setParameter("Ds_Merchant_PayMethods", 'z'); - } + + $miObj->setParameter("Ds_Merchant_Amount", (int) (round($params["amount"] * 100))); + $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); + $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); + $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); + $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); + $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); + $miObj->setParameter("Ds_Merchant_MerchantURL", $merchantUrl); + $miObj->setParameter("Ds_Merchant_UrlOK", $returnURL); + $miObj->setParameter("Ds_Merchant_UrlKO", $cancelURL); + $miObj->setParameter("Ds_Merchant_ProductDescription", $description); + $miObj->setParameter("Ds_Merchant_Titular", $params["first_name"] . " " . $params["last_name"]); + $miObj->setParameter("Ds_Merchant_ConsumerLanguage", self::REDSYS_LANGUAGE_SPANISH); + if (!empty($params["is_bizum"])) { + $miObj->setParameter("Ds_Merchant_PayMethods", 'z'); } - else { + if (!empty($params["is_token"])) { $miObj->setParameter("DS_MERCHANT_IDENTIFIER", 'REQUIRED'); - $miObj->setParameter("Ds_Merchant_Amount", 0); - $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); - $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); - $miObj->setParameter("Ds_Merchant_Currency", self::REDSYS_CURRENCY_EURO); - $miObj->setParameter("Ds_Merchant_Terminal", $merchantTerminal); - $miObj->setParameter("Ds_Merchant_TransactionType", self::REDSYS_TRANSACTION_TYPE_OPERATION_STANDARD); } $version = "HMAC_SHA256_V1"; diff --git a/CRM/Core/Payment/RedsysIPN.php b/CRM/Core/Payment/RedsysIPN.php index 189eb8a..195cbab 100644 --- a/CRM/Core/Payment/RedsysIPN.php +++ b/CRM/Core/Payment/RedsysIPN.php @@ -91,6 +91,12 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN { Civi::log()->debug("Redsys IPN Error Updating contribution: " . $e->getMessage()); } } + + if(!empty($input["Ds_Merchant_Identifier"])) { + // Call the hook civicrm_redsysToken + CRM_Utils_Hooks_Offlinepay::redsystoken($input['contactID'], $input['contributionID'], $input["Ds_Merchant_Identifier"]); + } + return TRUE; } @@ -115,6 +121,13 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN { ]; $decodecResponseJson = $this->_redsysAPI->decodeMerchantParameters($input["Ds_MerchantParameters"]); $decodecResponse = json_decode($decodecResponseJson); + + // Capture if is incoming a Ds_Merchant_Identifier, a token + if (!empty($decodecResponse->Ds_Merchant_Identifier)) { + $input['Ds_Merchant_Identifier'] = $decodecResponse->Ds_Merchant_Identifier; + CRM_Utils_Hooks_Redsys::redsystoken($input['contactID'], $input['contributionID'], number_format(($decodecResponse->Ds_Amount / 100), 2)); + } + $input['Ds_MerchantCode'] = $decodecResponse->Ds_MerchantCode; $input['Ds_Response'] = $decodecResponse->Ds_Response; $input['Ds_AuthorisationCode'] = $decodecResponse->Ds_AuthorisationCode; diff --git a/CRM/Redsys/Form/Settings.php b/CRM/Redsys/Form/Settings.php index 5fc61d0..2b4405c 100644 --- a/CRM/Redsys/Form/Settings.php +++ b/CRM/Redsys/Form/Settings.php @@ -55,7 +55,7 @@ class CRM_Redsys_Form_Settings extends CRM_Core_Form { public function getPaymentProcessors() { // Get the Redsys payment processor type. - $paymentProcessorTypes = civicrm_api3('PaymentProcessorType', 'get', ['name' => ['IN' => ["Redsys", "Bizum"]]]); + $paymentProcessorTypes = civicrm_api3('PaymentProcessorType', 'get', ['name' => ['IN' => ["Redsys", "Bizum", "Redsys_Tokenization"]]]); $paymentProcessorTypesIds = []; foreach ($paymentProcessorTypes["values"] as $paymentProcessorType) { $paymentProcessorTypesIds[] = $paymentProcessorType["id"]; diff --git a/CRM/Redsys/Upgrader.php b/CRM/Redsys/Upgrader.php index ca8fa70..a8dfb8c 100644 --- a/CRM/Redsys/Upgrader.php +++ b/CRM/Redsys/Upgrader.php @@ -20,6 +20,9 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { // Add Bizum. $this->addBizumPayment(); + // Add token + $this->addTokenPayment(); + return TRUE; } @@ -88,6 +91,10 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { $this->addTokenPayment(); return TRUE; } + public function upgrade_4018() { + $this->addTokenPayment(); + return TRUE; + } /** * Add build menu @@ -194,7 +201,7 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { ]); if ($resultPaymentMethod["count"] == 0) { $params = [ - 'name' => 'Recurring Redsys', + 'name' => 'Redsys_Tokenization', 'title' => 'Recurring Redsys Payment Processor', 'description' => 'Works with Servired (Sermepa) and 4B (Pasat).', 'class_name' => 'Payment_RedsysToken', diff --git a/CRM/Utils/Hooks/Redsys.php b/CRM/Utils/Hooks/Redsys.php new file mode 100644 index 0000000..ca2ee95 --- /dev/null +++ b/CRM/Utils/Hooks/Redsys.php @@ -0,0 +1,17 @@ +invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, $fnSuffix); + } + else { + return CRM_Utils_Hook::singleton()->invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, CRM_Utils_Hook::$_nullObject, $fnSuffix); + } + } +} \ No newline at end of file diff --git a/templates/CRM/Redsys/Form/Settings.tpl b/templates/CRM/Redsys/Form/Settings.tpl index 588c5e6..0ec51df 100644 --- a/templates/CRM/Redsys/Form/Settings.tpl +++ b/templates/CRM/Redsys/Form/Settings.tpl @@ -7,7 +7,7 @@ {$form.ipn_http.html}
- Redsys doesn't support ipn callbacks using SSL shared certificate in multiples websites with a single IP. In that case you must force to use http protocol in ipn callback url + Redsys doesn't support ipn callbacks using SSL shared certificate in multiples websites with a single IP. In that case you must force to use http protocol in ipn callback url @@ -24,7 +24,7 @@ {foreach key=property item=terminal from=$form name=terminals} {if $smarty.foreach.terminals.first} - Merchant terminal numbers for specific payment prcessors + Merchant terminal numbers for specific payment processors {/if} -- GitLab From f2509d2033a0e86e32310adf61fa1588090bd521 Mon Sep 17 00:00:00 2001 From: Ruben Date: Fri, 16 Apr 2021 14:28:58 +0000 Subject: [PATCH 4/7] Replace hook procedure to call, clean --- CRM/Core/Payment/RedsysIPN.php | 7 +------ CRM/Redsys/Upgrader.php | 2 +- CRM/Utils/Hooks/Redsys.php | 31 +++++++++++++++++++++++-------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/CRM/Core/Payment/RedsysIPN.php b/CRM/Core/Payment/RedsysIPN.php index 195cbab..3f662ae 100644 --- a/CRM/Core/Payment/RedsysIPN.php +++ b/CRM/Core/Payment/RedsysIPN.php @@ -92,11 +92,6 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN { } } - if(!empty($input["Ds_Merchant_Identifier"])) { - // Call the hook civicrm_redsysToken - CRM_Utils_Hooks_Offlinepay::redsystoken($input['contactID'], $input['contributionID'], $input["Ds_Merchant_Identifier"]); - } - return TRUE; } @@ -125,7 +120,7 @@ class CRM_Core_Payment_RedsysIPN extends CRM_Core_Payment_BaseIPN { // Capture if is incoming a Ds_Merchant_Identifier, a token if (!empty($decodecResponse->Ds_Merchant_Identifier)) { $input['Ds_Merchant_Identifier'] = $decodecResponse->Ds_Merchant_Identifier; - CRM_Utils_Hooks_Redsys::redsystoken($input['contactID'], $input['contributionID'], number_format(($decodecResponse->Ds_Amount / 100), 2)); + CRM_Utils_Hooks_Redsys::redsystoken($input['contactID'], $input['contributionID'], $input['Ds_Merchant_Identifier'], number_format(($decodecResponse->Ds_Amount / 100), 2)); } $input['Ds_MerchantCode'] = $decodecResponse->Ds_MerchantCode; diff --git a/CRM/Redsys/Upgrader.php b/CRM/Redsys/Upgrader.php index a8dfb8c..f4f7f31 100644 --- a/CRM/Redsys/Upgrader.php +++ b/CRM/Redsys/Upgrader.php @@ -197,7 +197,7 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { private static function addTokenPayment() { $resultPaymentMethod = civicrm_api3('PaymentProcessorType', 'get', [ 'sequential' => 1, - 'name' => "Recurring Redsys", + 'name' => "Redsys_Tokenization", ]); if ($resultPaymentMethod["count"] == 0) { $params = [ diff --git a/CRM/Utils/Hooks/Redsys.php b/CRM/Utils/Hooks/Redsys.php index ca2ee95..3909301 100644 --- a/CRM/Utils/Hooks/Redsys.php +++ b/CRM/Utils/Hooks/Redsys.php @@ -2,16 +2,31 @@ class CRM_Utils_Hooks_Redsys { - public static function redsystoken($contact_id, $contribution_id, $amount) { - return self::callHookByVersion(3, $contact_id, $contribution_id, $token, $amount, CRM_Utils_Hook::$_nullObject, 'civicrm_redsystoken'); + public static function redsystoken($contact_id, $contribution_id, $token, $amount) { + $names = ['contact_id', 'contribution_id', 'token', 'amount']; + $args = [$contact_id, $contribution_id, $token, $amount]; + + return self::invokeHook($names, $args, 'civicrm_redsystoken'); } - public static function callHookByVersion($numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, $fnSuffix) { - if (version_compare(CRM_Utils_System::version(), '4.5', '<')) { - return CRM_Utils_Hook::singleton()->invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, $fnSuffix); - } - else { - return CRM_Utils_Hook::singleton()->invoke($numParams, $arg1, $arg2, $arg3, $arg4, $arg5, CRM_Utils_Hook::$_nullObject, $fnSuffix); + private static function invokeHook($names, &$args, $fnSuffix) { + // Invoke classic hooks (legacy) + for ($i = 0; $i < 6; $i++) { + if (!isset($args[$i])) { + $args[$i] = CRM_Utils_Hook::$_nullObject; + } } + CRM_Utils_Hook::singleton() + ->invoke($names, $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $fnSuffix); + + // Invoke Symfony Dispatch (new convention) + $event = \Civi\Core\Event\GenericHookEvent::createOrdered( + $names, + [&$args[0], &$args[1], &$args[2], &$args[3], &$args[4], &$args[5]] + ); + $fnSuffix = str_replace("civicrm_", "", $fnSuffix); + + \Civi::dispatcher()->dispatch('redsys.' . $fnSuffix, $event); + return $event->getReturnValues(); } } \ No newline at end of file -- GitLab From f2dc66937a40895e8681087041fd86db975b9243 Mon Sep 17 00:00:00 2001 From: sluc23 Date: Wed, 26 May 2021 16:01:15 +0000 Subject: [PATCH 5/7] Apply 1 suggestion(s) to 1 file(s) --- CRM/Core/Payment/RedsysToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Payment/RedsysToken.php b/CRM/Core/Payment/RedsysToken.php index 62fc62d..26e36b8 100644 --- a/CRM/Core/Payment/RedsysToken.php +++ b/CRM/Core/Payment/RedsysToken.php @@ -1,7 +1,7 @@ Date: Wed, 26 May 2021 16:15:34 +0000 Subject: [PATCH 6/7] Format and duplicated process in upgrade extensions/redsys!48 --- CRM/Core/Payment/Redsys.php | 1 - CRM/Redsys/Upgrader.php | 4 ---- 2 files changed, 5 deletions(-) diff --git a/CRM/Core/Payment/Redsys.php b/CRM/Core/Payment/Redsys.php index f1fb157..9a72b42 100644 --- a/CRM/Core/Payment/Redsys.php +++ b/CRM/Core/Payment/Redsys.php @@ -230,7 +230,6 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment { } $miObj = new RedsysAPI(); - $miObj->setParameter("Ds_Merchant_Amount", (int) (round($params["amount"] * 100))); $miObj->setParameter("Ds_Merchant_Order", strval(self::formatAmount($params["contributionID"], 12))); $miObj->setParameter("Ds_Merchant_MerchantCode", $this->_paymentProcessor["user_name"]); diff --git a/CRM/Redsys/Upgrader.php b/CRM/Redsys/Upgrader.php index f4f7f31..fee5046 100644 --- a/CRM/Redsys/Upgrader.php +++ b/CRM/Redsys/Upgrader.php @@ -91,10 +91,6 @@ class CRM_Redsys_Upgrader extends CRM_Redsys_Upgrader_Base { $this->addTokenPayment(); return TRUE; } - public function upgrade_4018() { - $this->addTokenPayment(); - return TRUE; - } /** * Add build menu -- GitLab From 6e3809ed01a3ed91e25bf099788e045fb1bcc20a Mon Sep 17 00:00:00 2001 From: Ruben Date: Thu, 27 May 2021 14:42:11 +0000 Subject: [PATCH 7/7] Replace parameter capitalized 'Ds_Merchant_Identifier' extensions/redsys!48 --- CRM/Core/Payment/Redsys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Payment/Redsys.php b/CRM/Core/Payment/Redsys.php index 9a72b42..4b5737c 100644 --- a/CRM/Core/Payment/Redsys.php +++ b/CRM/Core/Payment/Redsys.php @@ -246,7 +246,7 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment { $miObj->setParameter("Ds_Merchant_PayMethods", 'z'); } if (!empty($params["is_token"])) { - $miObj->setParameter("DS_MERCHANT_IDENTIFIER", 'REQUIRED'); + $miObj->setParameter("Ds_Merchant_Identifier", 'REQUIRED'); } $version = "HMAC_SHA256_V1"; -- GitLab