From 519f55bb726e4134b7c65700352a46e17970a86a Mon Sep 17 00:00:00 2001 From: kGablo Date: Mon, 8 Jan 2024 14:58:58 +0100 Subject: [PATCH] cards_view --- Model/TpayConfig.php | 15 +++++++++++++++ etc/config.xml | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/Model/TpayConfig.php b/Model/TpayConfig.php index 08a48f5..a232615 100644 --- a/Model/TpayConfig.php +++ b/Model/TpayConfig.php @@ -32,6 +32,21 @@ public function afterGetAvailableMethods(MethodList $compiled, $result) { $onsiteChannels = $this->scopeConfig->getValue(self::CONFIG_PATH, ScopeInterface::SCOPE_STORE); + $secondTpay = false; + foreach ($result as $paymentMethod) { + if ($paymentMethod->getCode() == 'tpaycom_magento2basic') { + if ($secondTpay) { + $paymentMethod->setCode('tpaycom_magento2basic_cards'); + } else { + $secondTpay = true; + } + } + } + + if (!$onsiteChannels){ + return $result; + } + foreach (explode(',', $onsiteChannels) as $onsiteChannel) { $method = $this->data->getMethodInstance('generic'); $method->setChannelId($onsiteChannel); diff --git a/etc/config.xml b/etc/config.xml index a5e6c07..3654c63 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -29,6 +29,24 @@ PLN 0 + + pending_payment + 0 + tpaycom\magento2basic\Model\Tpay + Karty + 0 + 0.10 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + PLN + 1 + 0 + pending_payment 0