From 1f0c5cf6d9b5af099bc8aef1b23287ff01a4c5f0 Mon Sep 17 00:00:00 2001 From: Marijus <106698165+MarijusCoding@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:00:39 +0200 Subject: [PATCH] Revert "SL-271 New payment methods integration" --- saferpayofficial.php | 5 +---- src/Config/SaferPayConfig.php | 12 ++---------- src/Service/LegacyTranslator.php | 4 ---- src/Service/SaferPayObtainPaymentMethods.php | 1 + 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/saferpayofficial.php b/saferpayofficial.php index 6c212658..c467a61a 100755 --- a/saferpayofficial.php +++ b/saferpayofficial.php @@ -21,8 +21,6 @@ *@license SIX Payment Services */ -use Invertus\SaferPay\Config\SaferPayConfig; - if (!defined('_PS_VERSION_')) { exit; } @@ -222,8 +220,7 @@ public function hookPaymentOptions($params) continue; } - if (!in_array($this->context->currency->iso_code, $paymentMethods[$paymentMethod['paymentMethod']]['currencies']) - && !in_array($paymentMethod['paymentMethod'], SaferPayConfig::WALLET_PAYMENT_METHODS)) { + if (!in_array($this->context->currency->iso_code, $paymentMethods[$paymentMethod['paymentMethod']]['currencies'])) { continue; } diff --git a/src/Config/SaferPayConfig.php b/src/Config/SaferPayConfig.php index 921d935f..d1e6b359 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.43'; + const API_VERSION = '1.40'; const PAYMENT_METHODS = [ self::PAYMENT_ALIPAY, self::PAYMENT_AMEX, @@ -78,7 +78,6 @@ class SaferPayConfig self::PAYMENT_WLCRYPTOPAYMENTS, self::PAYMENT_WECHATPAY, self::PAYMENT_ACCOUNTTOACCOUNT, - self::PAYMENT_CLICKTOPAY, ]; const PAYMENT_ALIPAY = 'ALIPAY'; @@ -114,13 +113,10 @@ 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 = [ @@ -148,8 +144,6 @@ class SaferPayConfig 'Card' => self::PAYMENT_CARD, 'PostFinancePay' => self::PAYMENT_POSTFINANCE_PAY, 'WeChatPay' => self::PAYMENT_WECHATPAY, - 'ClickToPay' => self::PAYMENT_CLICKTOPAY, - 'Blik' => self::PAYMENT_BLIK, ]; const FIELD_SUPPORTED_PAYMENT_METHODS = [ @@ -321,9 +315,7 @@ public static function isRedirectPayment($paymentMethod) self::PAYMENT_POSTFINANCE_PAY, self::PAYMENT_DIRECTDEBIT, self::PAYMENT_SOFORT, - self::PAYMENT_PAYPAL, - self::PAYMENT_CLICKTOPAY, - self::PAYMENT_BLIK, + self::PAYMENT_PAYPAL ]; return in_array($paymentMethod, $paymentsAlwaysRedirect); diff --git a/src/Service/LegacyTranslator.php b/src/Service/LegacyTranslator.php index 2ef1ce6f..5c53b5d2 100755 --- a/src/Service/LegacyTranslator.php +++ b/src/Service/LegacyTranslator.php @@ -25,7 +25,6 @@ use Invertus\SaferPay\Config\SaferPayConfig; use Invertus\SaferPay\Factory\ModuleFactory; -use PrestaShop\Module\PsAccounts\Vendor\phpseclib\Net\SSH1; use SaferPayOfficial; if (!defined('_PS_VERSION_')) { @@ -83,9 +82,6 @@ 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 86e7a625..27a00dbe 100755 --- a/src/Service/SaferPayObtainPaymentMethods.php +++ b/src/Service/SaferPayObtainPaymentMethods.php @@ -87,6 +87,7 @@ public function obtainPaymentMethods() $paymentMethods[$wallet->WalletName] = [ 'paymentMethod' => $wallet->WalletName, 'logoUrl' => $wallet->LogoUrl, + 'currencies' => $paymentMethodObject->Currencies, ]; } }