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 3e65f34a..84da8ccd 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'; } diff --git a/src/PaymentMethods/Swish.php b/src/PaymentMethods/Swish.php new file mode 100644 index 00000000..704fbc04 --- /dev/null +++ b/src/PaymentMethods/Swish.php @@ -0,0 +1,32 @@ + 'swish', + 'defaultTitle' => __('Swish', 'mollie-payments-for-woocommerce'), + 'settingsDescription' => '', + 'defaultDescription' => '', + 'paymentFields' => false, + 'instructions' => false, + 'supports' => [ + 'products', + 'refunds', + ], + 'filtersOnBuild' => false, + 'confirmationDelayed' => false, + 'SEPA' => false, + ]; + } + + public function getFormFields($generalFormFields): array + { + return $generalFormFields; + } +} diff --git a/src/Shared/SharedDataDictionary.php b/src/Shared/SharedDataDictionary.php index 7bd19e9d..e33282c2 100644 --- a/src/Shared/SharedDataDictionary.php +++ b/src/Shared/SharedDataDictionary.php @@ -39,6 +39,7 @@ class SharedDataDictionary 'Mollie_WC_Gateway_Payconiq', 'Mollie_WC_Gateway_Riverty', 'Mollie_WC_Gateway_Satispay', + 'Mollie_WC_Gateway_Swish', ]; public const MOLLIE_OPTIONS_NAMES = [