From 7e2bcb0e2e2e746808f111efc9aa68b478526dc3 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 3 Jun 2024 11:26:56 +0200 Subject: [PATCH] Put alma method under flag default hidden --- src/Gateway/GatewayModule.php | 6 ++++++ src/PaymentMethods/Constants.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 889769de..1e9602df 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -118,6 +118,12 @@ public function services(): array return $method['id'] !== Constants::BANCOMATPAY; }); } + $almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', false); + if (!$almaFlag) { + return array_filter($availablePaymentMethods, static function ($method) { + return $method['id'] !== Constants::ALMA; + }); + } return $availablePaymentMethods; }, 'gateway.isSDDGatewayEnabled' => static function (ContainerInterface $container): bool { diff --git a/src/PaymentMethods/Constants.php b/src/PaymentMethods/Constants.php index 6f62e6b2..d8597c60 100644 --- a/src/PaymentMethods/Constants.php +++ b/src/PaymentMethods/Constants.php @@ -12,4 +12,6 @@ class Constants public const BANKTRANSFER = 'banktransfer'; public const BANCOMATPAY = 'bancomatpay'; + + public const ALMA = 'alma'; }