From 4bacd7de7e11670c6323ab7099ee75cb2c57686c Mon Sep 17 00:00:00 2001 From: jevgenijvisockij Date: Tue, 14 May 2024 17:42:56 +0300 Subject: [PATCH] Make Alma payment only method --- src/Builder/FormBuilder.php | 1 + src/Config/Config.php | 4 ++++ views/templates/admin/_configure/helpers/form/form.tpl | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Builder/FormBuilder.php b/src/Builder/FormBuilder.php index dafc6e38a..871d53870 100644 --- a/src/Builder/FormBuilder.php +++ b/src/Builder/FormBuilder.php @@ -423,6 +423,7 @@ protected function getAccountSettingsSection($isApiKeyProvided) 'taxRulesGroups' => $this->taxRulesGroupRepository->getTaxRulesGroups($this->context->getShopId()), 'tab' => $generalSettings, 'onlyOrderMethods' => Config::ORDER_API_ONLY_METHODS, + 'onlyPaymentsMethods' => Config::PAYMENT_API_ONLY_METHODS, 'displayErrors' => $this->configuration->get(Config::MOLLIE_DISPLAY_ERRORS), 'methodDescription' => TagsUtility::ppTags( $this->module->l('[1]Read more[/1] about the differences between Payments and Orders API.', self::FILE_NAME), diff --git a/src/Config/Config.php b/src/Config/Config.php index 7bbf6a0b4..8587ff0c3 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -280,6 +280,10 @@ class Config self::MOLLIE_in3_METHOD_ID, ]; + const PAYMENT_API_ONLY_METHODS = [ + PaymentMethod::ALMA, + ]; + const ROUTE_RESEND_SECOND_CHANCE_PAYMENT_MESSAGE = 'mollie_module_admin_resend_payment_message'; const PAYMENT_FEE_SKU = 'payment-fee-sku'; diff --git a/views/templates/admin/_configure/helpers/form/form.tpl b/views/templates/admin/_configure/helpers/form/form.tpl index 8914d7d95..9a25e0de5 100644 --- a/views/templates/admin/_configure/helpers/form/form.tpl +++ b/views/templates/admin/_configure/helpers/form/form.tpl @@ -199,7 +199,9 @@ {if !in_array($paymentMethod.id, $input.onlyOrderMethods)} {/if} - + {if !in_array($paymentMethod.id, $input.onlyPaymentsMethods)} + + {/if}

{$input.methodDescription}