Skip to content

Commit

Permalink
PIPRES-410: BO - empty maximum fee will make this value unlimited
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed May 22, 2024
1 parent be0eda2 commit fe370e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Service/PaymentMethodService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion views/templates/admin/_configure/helpers/form/form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
<input type="text"
name="MOLLIE_METHOD_SURCHARGE_LIMIT_{$paymentMethod.id|escape:'html':'UTF-8'}"
class="fixed-width-xl js-mollie-amount"
value="{$methodObj->surcharge_limit|escape:'html':'UTF-8'}">
value="{if $methodObj->surcharge_limit === $paymentMethod.maximumAmount}{else}{$methodObj->surcharge_limit|escape:'html':'UTF-8'}{/if}">
</div>
</div>
<div class="form-group">
Expand Down

0 comments on commit fe370e1

Please sign in to comment.