From 2330d3b5443d61fd777b19e9bd75db73212a9b3c Mon Sep 17 00:00:00 2001 From: Christian Proske Date: Tue, 3 May 2022 15:48:28 +0200 Subject: [PATCH 1/2] PUI optional --- info.xml | 11 ++++++++++- paymentmethod/Banktransfer.php | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/info.xml b/info.xml index 2d86d2f..12a9984 100644 --- a/info.xml +++ b/info.xml @@ -8,7 +8,7 @@ 5.0.0 ws5_mollie 2021-12-06 - 1.3.4 + 1.3.5 689388c6-9f04-4648-b516-e67d96b0dc1d @@ -694,6 +694,15 @@ + + PUI Daten übergeben + Macht den Auftrag in der WAWI ReadOnly. + usePUI + + + + + Gültigkeit in Tagen Wie lange hat der Kunde Zeit die Überweisung zu tätigen? diff --git a/paymentmethod/Banktransfer.php b/paymentmethod/Banktransfer.php index 9d4efeb..0151d43 100644 --- a/paymentmethod/Banktransfer.php +++ b/paymentmethod/Banktransfer.php @@ -22,6 +22,11 @@ class Banktransfer extends PaymentMethod public function generatePUI(AbstractCheckout $checkout): string { + + if(self::Plugin('ws5_mollie')->getConfig()->getValue($this->moduleID . '_usePUI') === 'N'){ + return false; + } + $template = self::Plugin('ws5_mollie')->getLocalization()->getTranslation('banktransferPUI'); return str_replace( From 928c6090343b5c60974aed8473c6f3f404f67978 Mon Sep 17 00:00:00 2001 From: Christian Proske Date: Tue, 3 May 2022 16:03:44 +0200 Subject: [PATCH 2/2] close #104 --- Bootstrap.php | 5 +++-- info.xml | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Bootstrap.php b/Bootstrap.php index 5270a85..39420b9 100644 --- a/Bootstrap.php +++ b/Bootstrap.php @@ -37,7 +37,8 @@ public function boot(Dispatcher $dispatcher): void parent::boot($dispatcher); if (!Shop::isFrontend()) { - if ($authorized = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_orders WHERE cStatus = "authorized" AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY)', ReturnType::AFFECTED_ROWS)) { + $notificationSetting = self::Plugin('ws5_mollie')->getConfig()->getValue("notifications"); + if (in_array($notificationSetting, ['Y', 'A']) && $authorized = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_orders WHERE cStatus = "authorized" AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY)', ReturnType::AFFECTED_ROWS)) { Notification::getInstance()->add( NotificationEntry::TYPE_WARNING, 'Mollie Authorized Orders', @@ -46,7 +47,7 @@ public function boot(Dispatcher $dispatcher): void ); } - if ($errors = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_queue WHERE cError IS NOT NULL AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY);', ReturnType::AFFECTED_ROWS)) { + if (in_array($notificationSetting, ['Y', 'Q']) && $errors = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_queue WHERE cError IS NOT NULL AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY);', ReturnType::AFFECTED_ROWS)) { Notification::getInstance()->add( NotificationEntry::TYPE_DANGER, 'Mollie Queue with Errors', diff --git a/info.xml b/info.xml index 12a9984..396957a 100644 --- a/info.xml +++ b/info.xml @@ -7,7 +7,7 @@ 102 5.0.0 ws5_mollie - 2021-12-06 + 2022-05-03 1.3.5 689388c6-9f04-4648-b516-e67d96b0dc1d @@ -197,6 +197,19 @@ + + Mitteilungen (Glocke) + + + notifications + + + + + + + +