Skip to content

Commit

Permalink
Merge branch 'refs/heads/feature/PIWOO-538-add-swish-method' into rel…
Browse files Browse the repository at this point in the history
…ease/7.8.1-beta
  • Loading branch information
mmaymo committed Sep 25, 2024
2 parents 834c804 + 63ff8bc commit 74eb3e9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions public/images/swish.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/PaymentMethods/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
32 changes: 32 additions & 0 deletions src/PaymentMethods/Swish.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Mollie\WooCommerce\PaymentMethods;

class Swish extends AbstractPaymentMethod implements PaymentMethodI
{
public function getConfig(): array
{
return [
'id' => '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;
}
}
1 change: 1 addition & 0 deletions src/Shared/SharedDataDictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 74eb3e9

Please sign in to comment.