From 63ff8bcc003daf6b9a7d9bccb13f29e8a65a7ada Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Tue, 24 Sep 2024 12:16:59 +0200 Subject: [PATCH] Add swish after flag default false --- public/images/swish.svg | 1 + src/Gateway/GatewayModule.php | 6 ++++++ src/PaymentMethods/Constants.php | 3 +-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 public/images/swish.svg diff --git a/public/images/swish.svg b/public/images/swish.svg new file mode 100644 index 00000000..23a795e0 --- /dev/null +++ b/public/images/swish.svg @@ -0,0 +1 @@ + diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 0004ef09..6e16668c 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -124,6 +124,12 @@ public function services(): array return $method['id'] !== Constants::ALMA; }); } + $swishFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.swish_enabled', false); + if (!$swishFlag) { + $availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) { + return $method['id'] !== Constants::SWISH; + }); + } return $availablePaymentMethods; }, 'gateway.isSDDGatewayEnabled' => static function (ContainerInterface $container): bool { diff --git a/src/PaymentMethods/Constants.php b/src/PaymentMethods/Constants.php index d8597c60..c74ce5f0 100644 --- a/src/PaymentMethods/Constants.php +++ b/src/PaymentMethods/Constants.php @@ -10,8 +10,7 @@ class Constants public const KLARNA = 'klarna'; public const DIRECTDEBIT = 'directdebit'; public const BANKTRANSFER = 'banktransfer'; - public const BANCOMATPAY = 'bancomatpay'; - public const ALMA = 'alma'; + public const SWISH = 'swish'; }