From fe370e19e7b029479be70eec69135f9354ea1fd7 Mon Sep 17 00:00:00 2001 From: Gytautas Date: Wed, 22 May 2024 10:28:03 +0300 Subject: [PATCH] PIPRES-410: BO - empty maximum fee will make this value unlimited --- src/Service/PaymentMethodService.php | 4 +++- views/templates/admin/_configure/helpers/form/form.tpl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Service/PaymentMethodService.php b/src/Service/PaymentMethodService.php index f5f6cd9bf..24fce0c4c 100644 --- a/src/Service/PaymentMethodService.php +++ b/src/Service/PaymentMethodService.php @@ -177,7 +177,9 @@ public function savePaymentMethod($method) $paymentMethod->surcharge_fixed_amount_tax_excl = Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_SURCHARGE_FIXED_AMOUNT_TAX_EXCL . $method['id']); $paymentMethod->tax_rules_group_id = Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_TAX_RULES_GROUP_ID . $method['id']); $paymentMethod->surcharge_percentage = Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_SURCHARGE_PERCENTAGE . $method['id']); - $paymentMethod->surcharge_limit = Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_SURCHARGE_LIMIT . $method['id']); + $paymentMethod->surcharge_limit = Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_SURCHARGE_LIMIT . $method['id']) === '' + ? (float) Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_MAX_AMOUNT . $method['id']) + : Tools::getValue(Mollie\Config\Config::MOLLIE_METHOD_SURCHARGE_LIMIT . $method['id']); $paymentMethod->images_json = json_encode($method['image']); $paymentMethod->live_environment = $environment; $paymentMethod->id_shop = $shopId; diff --git a/views/templates/admin/_configure/helpers/form/form.tpl b/views/templates/admin/_configure/helpers/form/form.tpl index 9a25e0de5..c160578c6 100644 --- a/views/templates/admin/_configure/helpers/form/form.tpl +++ b/views/templates/admin/_configure/helpers/form/form.tpl @@ -365,7 +365,7 @@ + value="{if $methodObj->surcharge_limit === $paymentMethod.maximumAmount}{else}{$methodObj->surcharge_limit|escape:'html':'UTF-8'}{/if}">