From 74df9853746bd688d135771cb16956022fc1c3a5 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 12 Dec 2024 10:25:54 +0200 Subject: [PATCH 1/2] SL-271] re-added --- saferpayofficial.php | 5 ++++- src/Config/SaferPayConfig.php | 11 +++++++++-- src/Service/LegacyTranslator.php | 3 +++ src/Service/SaferPayObtainPaymentMethods.php | 1 - 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/saferpayofficial.php b/saferpayofficial.php index c467a61a..6c212658 100755 --- a/saferpayofficial.php +++ b/saferpayofficial.php @@ -21,6 +21,8 @@ *@license SIX Payment Services */ +use Invertus\SaferPay\Config\SaferPayConfig; + if (!defined('_PS_VERSION_')) { exit; } @@ -220,7 +222,8 @@ public function hookPaymentOptions($params) continue; } - if (!in_array($this->context->currency->iso_code, $paymentMethods[$paymentMethod['paymentMethod']]['currencies'])) { + if (!in_array($this->context->currency->iso_code, $paymentMethods[$paymentMethod['paymentMethod']]['currencies']) + && !in_array($paymentMethod['paymentMethod'], SaferPayConfig::WALLET_PAYMENT_METHODS)) { continue; } diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index d1e6b359..aaa47760 100755 --- a/src/Config/SaferPayConfig.php +++ b/src/Config/SaferPayConfig.php @@ -49,7 +49,7 @@ class SaferPayConfig const RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT = 'SAFERPAY_RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT'; const CONFIGURATION_NAME = 'SAFERPAY_CONFIGURATION_NAME'; const TEST_SUFFIX = '_TEST'; - const API_VERSION = '1.40'; + const API_VERSION = '1.43'; const PAYMENT_METHODS = [ self::PAYMENT_ALIPAY, self::PAYMENT_AMEX, @@ -78,6 +78,7 @@ class SaferPayConfig self::PAYMENT_WLCRYPTOPAYMENTS, self::PAYMENT_WECHATPAY, self::PAYMENT_ACCOUNTTOACCOUNT, + self::PAYMENT_CLICKTOPAY, ]; const PAYMENT_ALIPAY = 'ALIPAY'; @@ -113,10 +114,13 @@ class SaferPayConfig const PAYMENT_CARD = 'CARD'; const PAYMENT_POSTFINANCE_PAY = 'POSTFINANCEPAY'; const PAYMENT_WECHATPAY = 'WECHATPAY'; + const PAYMENT_CLICKTOPAY = 'CLICKTOPAY'; + const PAYMENT_BLIK = 'BLIK'; const WALLET_PAYMENT_METHODS = [ self::PAYMENT_APPLEPAY, self::PAYMENT_GOOGLEPAY, + self::PAYMENT_CLICKTOPAY, ]; const PAYMENT_METHODS_KEYS = [ @@ -144,6 +148,7 @@ class SaferPayConfig 'Card' => self::PAYMENT_CARD, 'PostFinancePay' => self::PAYMENT_POSTFINANCE_PAY, 'WeChatPay' => self::PAYMENT_WECHATPAY, + 'Blik' => self::PAYMENT_BLIK, ]; const FIELD_SUPPORTED_PAYMENT_METHODS = [ @@ -315,7 +320,9 @@ public static function isRedirectPayment($paymentMethod) self::PAYMENT_POSTFINANCE_PAY, self::PAYMENT_DIRECTDEBIT, self::PAYMENT_SOFORT, - self::PAYMENT_PAYPAL + self::PAYMENT_PAYPAL, + self::PAYMENT_CLICKTOPAY, + self::PAYMENT_BLIK, ]; return in_array($paymentMethod, $paymentsAlwaysRedirect); diff --git a/src/Service/LegacyTranslator.php b/src/Service/LegacyTranslator.php index 5c53b5d2..e87ce4e7 100755 --- a/src/Service/LegacyTranslator.php +++ b/src/Service/LegacyTranslator.php @@ -82,6 +82,9 @@ private function getTranslations() SaferPayConfig::PAYMENT_CARD => $this->module->l('Card', self::FILE_NAME), SaferPayConfig::PAYMENT_POSTFINANCE_PAY => $this->module->l('PostFinancePay', self::FILE_NAME), SaferPayConfig::PAYMENT_WECHATPAY => $this->module->l('WeChatPay', self::FILE_NAME), + SaferPayConfig::PAYMENT_BLIK => $this->module->l('Blik', self::FILE_NAME), + SaferPayConfig::PAYMENT_GOOGLEPAY => $this->module->l('Googlepay'), + SaferPayConfig::PAYMENT_CLICKTOPAY => $this->module->l('Clicktopay', self::FILE_NAME), ]; } } diff --git a/src/Service/SaferPayObtainPaymentMethods.php b/src/Service/SaferPayObtainPaymentMethods.php index 27a00dbe..86e7a625 100755 --- a/src/Service/SaferPayObtainPaymentMethods.php +++ b/src/Service/SaferPayObtainPaymentMethods.php @@ -87,7 +87,6 @@ public function obtainPaymentMethods() $paymentMethods[$wallet->WalletName] = [ 'paymentMethod' => $wallet->WalletName, 'logoUrl' => $wallet->LogoUrl, - 'currencies' => $paymentMethodObject->Currencies, ]; } } From efb7a6d87330de81adb196edae13d30fdae60e0a Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Thu, 12 Dec 2024 10:27:06 +0200 Subject: [PATCH 2/2] [SL-271] updated changelog --- changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 3ffb1c8d..cb75bdff 100755 --- a/changelog.md +++ b/changelog.md @@ -175,4 +175,7 @@ - Implemented code logging - Requiring card holder name when entering card details - Removed depreciated feature for custom CSS -- Compatibility with most popular OPC modules (The Checkout, Super Checkout, One Page Checkout PS) \ No newline at end of file +- Compatibility with most popular OPC modules (The Checkout, Super Checkout, One Page Checkout PS) + +## [1.2.5] +- Added new payment methods: Blik, ClickToPay \ No newline at end of file