Skip to content

Commit

Permalink
Merge pull request mollie#924 from mollie/PIPRES-407
Browse files Browse the repository at this point in the history
Make Alma payment only method
  • Loading branch information
JevgenijVisockij authored May 14, 2024
2 parents 8436ac1 + 4bacd7d commit be0eda2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Builder/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 3 additions & 1 deletion views/templates/admin/_configure/helpers/form/form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@
{if !in_array($paymentMethod.id, $input.onlyOrderMethods)}
<option value="payments" {if $methodObj->method === 'payments'} selected {/if}>{l s='Payments API' mod='mollie'}</option>
{/if}
<option value="orders" {if $methodObj->method === 'orders'} selected {/if}>{l s='Orders API' mod='mollie'}</option>
{if !in_array($paymentMethod.id, $input.onlyPaymentsMethods)}
<option value="orders" {if $methodObj->method === 'orders'} selected {/if}>{l s='Orders API' mod='mollie'}</option>
{/if}
</select>
<p class="help-block">
{$input.methodDescription}
Expand Down

0 comments on commit be0eda2

Please sign in to comment.