From fff2742e3bc350863b2a25d9861fdee0be87ee58 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Mon, 14 Oct 2024 11:18:18 +0300 Subject: [PATCH 01/14] fi --- saferpayofficial.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/saferpayofficial.php b/saferpayofficial.php index ae2d77b1..cf7b5ed8 100755 --- a/saferpayofficial.php +++ b/saferpayofficial.php @@ -369,6 +369,18 @@ public function hookActionFrontControllerSetMedia() $this->context->controller->addJs(Configuration::get($fieldsLibrary . $configSuffix)); } + break; + case \Invertus\SaferPay\Config\SaferPayConfig::ONE_PAGE_CHECKOUT_MODULE: + if (\Invertus\SaferPay\Config\SaferPayConfig::isVersion17()) { + $this->context->controller->addCSS("{$this->getPathUri()}views/css/front/saferpay_checkout.css"); + } else { + $this->context->controller->addCSS("{$this->getPathUri()}views/css/front/opc/thecheckout/saferpay_checkout_16.css"); + $this->context->controller->addJS("{$this->getPathUri()}views/js/front/opc/thecheckout/saferpay_saved_card_16.js"); + $fieldsLibrary = \Invertus\SaferPay\Config\SaferPayConfig::FIELDS_LIBRARY; + $configSuffix = \Invertus\SaferPay\Config\SaferPayConfig::getConfigSuffix(); + $this->context->controller->addJs(Configuration::get($fieldsLibrary . $configSuffix)); + } + break; } From 092ff2d90815b59880204c1d3504ecbab097beca Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 10:58:25 +0300 Subject: [PATCH 02/14] added compatibility opcps --- src/Config/SaferPayConfig.php | 2 +- .../Loader/PaymentFormAssetLoader.php | 18 +++++- .../opc/onepagecheckoutps/hosted_fields.js | 59 +++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 views/js/front/opc/onepagecheckoutps/hosted_fields.js diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 546ef3d4..2e02a8fe 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -279,7 +279,7 @@ class SaferPayConfig const SUPER_CHECKOUT_MODULE = 'supercheckout'; const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; - + const ONE_PAGE_CHECKOUT_FRONT_CONTROLLER = 'OrderController' || 'OrderControllerCore'; const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, self::THE_CHECKOUT_MODULE, diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 4eeceb44..1d1d5dd3 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -84,7 +84,23 @@ public function register($controller) private function registerOnePageCheckoutAssets($controller) { - // TODO: will be implemented in other branches + if (get_class($controller) != SaferPayConfig::ONE_PAGE_CHECKOUT_FRONT_CONTROLLER) { + return; + } + + $controller->addCSS("{$this->module->getPathUri()}views/css/front/saferpay_checkout.css"); + + if (method_exists($controller, 'registerJavascript')) { + $controller->registerJavascript( + 'saved_card_hosted_fields_opc', + "modules/saferpayofficial/views/js/front/opc/onepagecheckoutps/hosted_fields.js" + ); + } else { + $controller->addJs( + $this->module->getPathUri() . 'views/js/front/opc/onepagecheckoutps/hosted_fields.js', + false + ); + } } private function registerTheCheckoutAssets($controller) diff --git a/views/js/front/opc/onepagecheckoutps/hosted_fields.js b/views/js/front/opc/onepagecheckoutps/hosted_fields.js new file mode 100644 index 00000000..2b8162f7 --- /dev/null +++ b/views/js/front/opc/onepagecheckoutps/hosted_fields.js @@ -0,0 +1,59 @@ +/** + *NOTICE OF LICENSE + * + *This source file is subject to the Open Software License (OSL 3.0) + *that is bundled with this package in the file LICENSE.txt. + *It is also available through the world-wide-web at this URL: + *http://opensource.org/licenses/osl-3.0.php + *If you did not receive a copy of the license and are unable to + *obtain it through the world-wide-web, please send an email + *to license@prestashop.com so we can send you a copy immediately. + * + *DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + *versions in the future. If you wish to customize PrestaShop for your + *needs please refer to http://www.prestashop.com for more information. + * + *@author INVERTUS UAB www.invertus.eu + *@copyright SIX Payment Services + *@license SIX Payment Services + */ + +$(document).ready(function () { + $('body').on('change', "input[name^='saved_card_']", function () { + var $selectedCard = $(this); + var method = $selectedCard.closest('div.saved_cards').find('.saved_card_method').val(); + $("input[name='selectedCreditCard_" + method + "']").val($selectedCard.val()); + }); +}); + +$('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { + event.preventDefault(); + + var selectedCardMethod = $(this).find("[name=saved_card_method]").val(); + var selectedCard = $(this).find("[name=selectedCreditCard_" + selectedCardMethod + "]").val(); + + //NOTE: not saved card chosen, continuing with normal procedures. + if (selectedCard <= 0) { + event.target.submit(); + + return; + } + + $.ajax(saferpay_official_ajax_url, { + method: 'POST', + data: { + action: 'submitHostedFields', + paymentMethod: selectedCardMethod, + selectedCard: selectedCard, + isBusinessLicence: 1, + ajax: 1 + }, + success: function (response) { + var data = jQuery.parseJSON(response); + + window.location = data.url; + }, + }); +}); \ No newline at end of file From 38db797a33052d95946d2ca3750df75b323a9275 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:41:02 +0300 Subject: [PATCH 03/14] compatibility --- src/Config/SaferPayConfig.php | 1 + .../Loader/PaymentFormAssetLoader.php | 18 +++++- views/css/front/saferpay_checkout.css | 13 ++++ .../front/opc/supercheckout/hosted_fields.js | 59 +++++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 views/js/front/opc/supercheckout/hosted_fields.js diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 2e02a8fe..586eabaf 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -280,6 +280,7 @@ class SaferPayConfig const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; const ONE_PAGE_CHECKOUT_FRONT_CONTROLLER = 'OrderController' || 'OrderControllerCore'; + const SUPER_CHECKOUT_FRONT_CONTROLLER = 'SupercheckoutSupercheckoutModuleFrontController'; const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, self::THE_CHECKOUT_MODULE, diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 1d1d5dd3..730722da 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -126,7 +126,23 @@ private function registerTheCheckoutAssets($controller) private function registerSuperCheckoutAssets($controller) { - // TODO: will be implemented in other branches + if (get_class($controller) !== SaferPayConfig::SUPER_CHECKOUT_FRONT_CONTROLLER) { + return; + } + + $controller->addCSS("{$this->module->getPathUri()}views/css/front/saferpay_checkout.css"); + + if (method_exists($controller, 'registerJavascript')) { + $controller->registerJavascript( + 'saved_card_hosted_fields_opc', + "modules/saferpayofficial/views/js/front/opc/supercheckout/hosted_fields.js" + ); + } else { + $controller->addJs( + $this->module->getPathUri() . 'views/js/front/opc/supercheckout/hosted_fields.js', + false + ); + } } private function registerDefaultCheckoutAssets($controller) diff --git a/views/css/front/saferpay_checkout.css b/views/css/front/saferpay_checkout.css index f98495b3..a100ae4c 100755 --- a/views/css/front/saferpay_checkout.css +++ b/views/css/front/saferpay_checkout.css @@ -34,3 +34,16 @@ .payment-logo { max-width: 40px; } + +input[type="radio"][name^="saved_card_"] { + opacity: 1 !important; + width: 15px !important; + position: relative !important; + vertical-align: middle !important; + margin: 0 !important; +} +.saved_credit_cards span { + padding-left: 3px !important; + vertical-align: middle !important; + margin: 0 !important; +} diff --git a/views/js/front/opc/supercheckout/hosted_fields.js b/views/js/front/opc/supercheckout/hosted_fields.js new file mode 100644 index 00000000..2b8162f7 --- /dev/null +++ b/views/js/front/opc/supercheckout/hosted_fields.js @@ -0,0 +1,59 @@ +/** + *NOTICE OF LICENSE + * + *This source file is subject to the Open Software License (OSL 3.0) + *that is bundled with this package in the file LICENSE.txt. + *It is also available through the world-wide-web at this URL: + *http://opensource.org/licenses/osl-3.0.php + *If you did not receive a copy of the license and are unable to + *obtain it through the world-wide-web, please send an email + *to license@prestashop.com so we can send you a copy immediately. + * + *DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + *versions in the future. If you wish to customize PrestaShop for your + *needs please refer to http://www.prestashop.com for more information. + * + *@author INVERTUS UAB www.invertus.eu + *@copyright SIX Payment Services + *@license SIX Payment Services + */ + +$(document).ready(function () { + $('body').on('change', "input[name^='saved_card_']", function () { + var $selectedCard = $(this); + var method = $selectedCard.closest('div.saved_cards').find('.saved_card_method').val(); + $("input[name='selectedCreditCard_" + method + "']").val($selectedCard.val()); + }); +}); + +$('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { + event.preventDefault(); + + var selectedCardMethod = $(this).find("[name=saved_card_method]").val(); + var selectedCard = $(this).find("[name=selectedCreditCard_" + selectedCardMethod + "]").val(); + + //NOTE: not saved card chosen, continuing with normal procedures. + if (selectedCard <= 0) { + event.target.submit(); + + return; + } + + $.ajax(saferpay_official_ajax_url, { + method: 'POST', + data: { + action: 'submitHostedFields', + paymentMethod: selectedCardMethod, + selectedCard: selectedCard, + isBusinessLicence: 1, + ajax: 1 + }, + success: function (response) { + var data = jQuery.parseJSON(response); + + window.location = data.url; + }, + }); +}); \ No newline at end of file From e3bbf9cb76ddb76612aac4559d2b21154577f1d1 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:45:56 +0300 Subject: [PATCH 04/14] revert --- views/css/front/saferpay_checkout.css | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/views/css/front/saferpay_checkout.css b/views/css/front/saferpay_checkout.css index a100ae4c..f98495b3 100755 --- a/views/css/front/saferpay_checkout.css +++ b/views/css/front/saferpay_checkout.css @@ -34,16 +34,3 @@ .payment-logo { max-width: 40px; } - -input[type="radio"][name^="saved_card_"] { - opacity: 1 !important; - width: 15px !important; - position: relative !important; - vertical-align: middle !important; - margin: 0 !important; -} -.saved_credit_cards span { - padding-left: 3px !important; - vertical-align: middle !important; - margin: 0 !important; -} From e310a39a495cab575c7a237025054cd9d0a062c6 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:46:31 +0300 Subject: [PATCH 05/14] revert --- .../front/opc/supercheckout/hosted_fields.js | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 views/js/front/opc/supercheckout/hosted_fields.js diff --git a/views/js/front/opc/supercheckout/hosted_fields.js b/views/js/front/opc/supercheckout/hosted_fields.js deleted file mode 100644 index 2b8162f7..00000000 --- a/views/js/front/opc/supercheckout/hosted_fields.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 3.0) - *that is bundled with this package in the file LICENSE.txt. - *It is also available through the world-wide-web at this URL: - *http://opensource.org/licenses/osl-3.0.php - *If you did not receive a copy of the license and are unable to - *obtain it through the world-wide-web, please send an email - *to license@prestashop.com so we can send you a copy immediately. - * - *DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - *versions in the future. If you wish to customize PrestaShop for your - *needs please refer to http://www.prestashop.com for more information. - * - *@author INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -$(document).ready(function () { - $('body').on('change', "input[name^='saved_card_']", function () { - var $selectedCard = $(this); - var method = $selectedCard.closest('div.saved_cards').find('.saved_card_method').val(); - $("input[name='selectedCreditCard_" + method + "']").val($selectedCard.val()); - }); -}); - -$('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { - event.preventDefault(); - - var selectedCardMethod = $(this).find("[name=saved_card_method]").val(); - var selectedCard = $(this).find("[name=selectedCreditCard_" + selectedCardMethod + "]").val(); - - //NOTE: not saved card chosen, continuing with normal procedures. - if (selectedCard <= 0) { - event.target.submit(); - - return; - } - - $.ajax(saferpay_official_ajax_url, { - method: 'POST', - data: { - action: 'submitHostedFields', - paymentMethod: selectedCardMethod, - selectedCard: selectedCard, - isBusinessLicence: 1, - ajax: 1 - }, - success: function (response) { - var data = jQuery.parseJSON(response); - - window.location = data.url; - }, - }); -}); \ No newline at end of file From f5b367a42f44625857a733e52ad042835b95d015 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:47:36 +0300 Subject: [PATCH 06/14] revert --- .../Loader/PaymentFormAssetLoader.php | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 730722da..1d1d5dd3 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -126,23 +126,7 @@ private function registerTheCheckoutAssets($controller) private function registerSuperCheckoutAssets($controller) { - if (get_class($controller) !== SaferPayConfig::SUPER_CHECKOUT_FRONT_CONTROLLER) { - return; - } - - $controller->addCSS("{$this->module->getPathUri()}views/css/front/saferpay_checkout.css"); - - if (method_exists($controller, 'registerJavascript')) { - $controller->registerJavascript( - 'saved_card_hosted_fields_opc', - "modules/saferpayofficial/views/js/front/opc/supercheckout/hosted_fields.js" - ); - } else { - $controller->addJs( - $this->module->getPathUri() . 'views/js/front/opc/supercheckout/hosted_fields.js', - false - ); - } + // TODO: will be implemented in other branches } private function registerDefaultCheckoutAssets($controller) From 857ba8289c691580029e4761286afe03ce171ffe Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:50:00 +0300 Subject: [PATCH 07/14] revert --- src/Config/SaferPayConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 586eabaf..2540af8f 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -280,7 +280,7 @@ class SaferPayConfig const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; const ONE_PAGE_CHECKOUT_FRONT_CONTROLLER = 'OrderController' || 'OrderControllerCore'; - const SUPER_CHECKOUT_FRONT_CONTROLLER = 'SupercheckoutSupercheckoutModuleFrontController'; + const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, self::THE_CHECKOUT_MODULE, From 0b7ffd7be456b0a9c13addb31f2723f58849dd89 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:56:47 +0300 Subject: [PATCH 08/14] Revert "revert" This reverts commit 857ba8289c691580029e4761286afe03ce171ffe. --- src/Config/SaferPayConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 2540af8f..586eabaf 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -280,7 +280,7 @@ class SaferPayConfig const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; const ONE_PAGE_CHECKOUT_FRONT_CONTROLLER = 'OrderController' || 'OrderControllerCore'; - + const SUPER_CHECKOUT_FRONT_CONTROLLER = 'SupercheckoutSupercheckoutModuleFrontController'; const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, self::THE_CHECKOUT_MODULE, From 71bc3c1ff89d5a35b73a3b3b41e6ea1decc1cf86 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:56:52 +0300 Subject: [PATCH 09/14] Revert "revert" This reverts commit f5b367a42f44625857a733e52ad042835b95d015. --- .../Loader/PaymentFormAssetLoader.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 1d1d5dd3..730722da 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -126,7 +126,23 @@ private function registerTheCheckoutAssets($controller) private function registerSuperCheckoutAssets($controller) { - // TODO: will be implemented in other branches + if (get_class($controller) !== SaferPayConfig::SUPER_CHECKOUT_FRONT_CONTROLLER) { + return; + } + + $controller->addCSS("{$this->module->getPathUri()}views/css/front/saferpay_checkout.css"); + + if (method_exists($controller, 'registerJavascript')) { + $controller->registerJavascript( + 'saved_card_hosted_fields_opc', + "modules/saferpayofficial/views/js/front/opc/supercheckout/hosted_fields.js" + ); + } else { + $controller->addJs( + $this->module->getPathUri() . 'views/js/front/opc/supercheckout/hosted_fields.js', + false + ); + } } private function registerDefaultCheckoutAssets($controller) From 840131998ae1354306d13ef01b5320476bce33e1 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:56:54 +0300 Subject: [PATCH 10/14] Revert "revert" This reverts commit e310a39a495cab575c7a237025054cd9d0a062c6. --- .../front/opc/supercheckout/hosted_fields.js | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 views/js/front/opc/supercheckout/hosted_fields.js diff --git a/views/js/front/opc/supercheckout/hosted_fields.js b/views/js/front/opc/supercheckout/hosted_fields.js new file mode 100644 index 00000000..2b8162f7 --- /dev/null +++ b/views/js/front/opc/supercheckout/hosted_fields.js @@ -0,0 +1,59 @@ +/** + *NOTICE OF LICENSE + * + *This source file is subject to the Open Software License (OSL 3.0) + *that is bundled with this package in the file LICENSE.txt. + *It is also available through the world-wide-web at this URL: + *http://opensource.org/licenses/osl-3.0.php + *If you did not receive a copy of the license and are unable to + *obtain it through the world-wide-web, please send an email + *to license@prestashop.com so we can send you a copy immediately. + * + *DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + *versions in the future. If you wish to customize PrestaShop for your + *needs please refer to http://www.prestashop.com for more information. + * + *@author INVERTUS UAB www.invertus.eu + *@copyright SIX Payment Services + *@license SIX Payment Services + */ + +$(document).ready(function () { + $('body').on('change', "input[name^='saved_card_']", function () { + var $selectedCard = $(this); + var method = $selectedCard.closest('div.saved_cards').find('.saved_card_method').val(); + $("input[name='selectedCreditCard_" + method + "']").val($selectedCard.val()); + }); +}); + +$('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { + event.preventDefault(); + + var selectedCardMethod = $(this).find("[name=saved_card_method]").val(); + var selectedCard = $(this).find("[name=selectedCreditCard_" + selectedCardMethod + "]").val(); + + //NOTE: not saved card chosen, continuing with normal procedures. + if (selectedCard <= 0) { + event.target.submit(); + + return; + } + + $.ajax(saferpay_official_ajax_url, { + method: 'POST', + data: { + action: 'submitHostedFields', + paymentMethod: selectedCardMethod, + selectedCard: selectedCard, + isBusinessLicence: 1, + ajax: 1 + }, + success: function (response) { + var data = jQuery.parseJSON(response); + + window.location = data.url; + }, + }); +}); \ No newline at end of file From 65cec16654bc9abe385ed7c50e0fec84e9d10293 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 17 Oct 2024 12:56:55 +0300 Subject: [PATCH 11/14] Revert "revert" This reverts commit e3bbf9cb76ddb76612aac4559d2b21154577f1d1. --- views/css/front/saferpay_checkout.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/views/css/front/saferpay_checkout.css b/views/css/front/saferpay_checkout.css index f98495b3..a100ae4c 100755 --- a/views/css/front/saferpay_checkout.css +++ b/views/css/front/saferpay_checkout.css @@ -34,3 +34,16 @@ .payment-logo { max-width: 40px; } + +input[type="radio"][name^="saved_card_"] { + opacity: 1 !important; + width: 15px !important; + position: relative !important; + vertical-align: middle !important; + margin: 0 !important; +} +.saved_credit_cards span { + padding-left: 3px !important; + vertical-align: middle !important; + margin: 0 !important; +} From dd2a27758b684b95a17524eb7de7c0c5379b4ca4 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Fri, 18 Oct 2024 15:44:28 +0300 Subject: [PATCH 12/14] fix --- src/Config/SaferPayConfig.php | 2 -- src/Presentation/Loader/PaymentFormAssetLoader.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 586eabaf..0a139e14 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -277,9 +277,7 @@ class SaferPayConfig const ONE_PAGE_CHECKOUT_MODULE = 'onepagecheckoutps'; const THE_CHECKOUT_MODULE = 'thecheckout'; const SUPER_CHECKOUT_MODULE = 'supercheckout'; - const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; - const ONE_PAGE_CHECKOUT_FRONT_CONTROLLER = 'OrderController' || 'OrderControllerCore'; const SUPER_CHECKOUT_FRONT_CONTROLLER = 'SupercheckoutSupercheckoutModuleFrontController'; const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 730722da..0e82fa6e 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -84,7 +84,7 @@ public function register($controller) private function registerOnePageCheckoutAssets($controller) { - if (get_class($controller) != SaferPayConfig::ONE_PAGE_CHECKOUT_FRONT_CONTROLLER) { + if (!$controller instanceof \OrderControllerCore) { return; } From 79911277233e690c753bfc4f055d23df2c80ffc7 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Fri, 18 Oct 2024 15:56:18 +0300 Subject: [PATCH 13/14] fix --- src/Presentation/Loader/PaymentFormAssetLoader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 0e82fa6e..3f2276b7 100755 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -26,6 +26,7 @@ use Configuration; use Invertus\SaferPay\Adapter\LegacyContext; use Invertus\SaferPay\Config\SaferPayConfig; +use Invertus\SaferPay\DTO\Request\Order; use Invertus\SaferPay\Enum\ControllerName; use Invertus\SaferPay\Enum\PaymentType; use Invertus\SaferPay\Factory\ModuleFactory; @@ -126,7 +127,7 @@ private function registerTheCheckoutAssets($controller) private function registerSuperCheckoutAssets($controller) { - if (get_class($controller) !== SaferPayConfig::SUPER_CHECKOUT_FRONT_CONTROLLER) { + if (!$controller instanceof \SupercheckoutSupercheckoutModuleFrontController) { return; } From 3ad9df9e035c96f81e728b720d34c647b2fa541c Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Fri, 18 Oct 2024 15:58:06 +0300 Subject: [PATCH 14/14] removed config --- src/Config/SaferPayConfig.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 0a139e14..e761bbb9 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -278,7 +278,6 @@ class SaferPayConfig const THE_CHECKOUT_MODULE = 'thecheckout'; const SUPER_CHECKOUT_MODULE = 'supercheckout'; const THE_CHECKOUT_FRONT_CONTROLLER = 'TheCheckoutModuleFrontController'; - const SUPER_CHECKOUT_FRONT_CONTROLLER = 'SupercheckoutSupercheckoutModuleFrontController'; const OPC_MODULE_LIST = [ self::ONE_PAGE_CHECKOUT_MODULE, self::THE_CHECKOUT_MODULE,