Skip to content

Commit 7111a67

Browse files
authored
Merge pull request #912 from mollie/release/7.5.3
Release/7.5.4
2 parents 5c2a361 + 7e2bcb0 commit 7111a67

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

mollie-payments-for-woocommerce.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Mollie Payments for WooCommerce
44
* Plugin URI: https://www.mollie.com
55
* Description: Accept payments in WooCommerce with the official Mollie plugin
6-
* Version: 7.5.4-beta
6+
* Version: 7.5.4
77
* Author: Mollie
88
* Author URI: https://www.mollie.com
99
* Requires at least: 5.0
@@ -12,7 +12,7 @@
1212
* Domain Path: /languages
1313
* License: GPLv2 or later
1414
* WC requires at least: 3.9
15-
* WC tested up to: 8.7
15+
* WC tested up to: 8.9
1616
* Requires PHP: 7.2
1717
* Requires Plugins: woocommerce
1818
*/

src/Gateway/GatewayModule.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public function services(): array
118118
return $method['id'] !== Constants::BANCOMATPAY;
119119
});
120120
}
121+
$almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', false);
122+
if (!$almaFlag) {
123+
return array_filter($availablePaymentMethods, static function ($method) {
124+
return $method['id'] !== Constants::ALMA;
125+
});
126+
}
121127
return $availablePaymentMethods;
122128
},
123129
'gateway.isSDDGatewayEnabled' => static function (ContainerInterface $container): bool {

src/Gateway/Surcharge.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ protected function calculate_percentage(WC_Cart $cart, array $gatewaySettings)
171171
if (empty($gatewaySettings[Surcharge::PERCENTAGE])) {
172172
return 0.0;
173173
}
174-
$percentageFee = $gatewaySettings[Surcharge::PERCENTAGE];
174+
$percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE];
175175
$subtotal = $cart->get_subtotal() + $cart->get_shipping_total() - $cart->get_discount_total();
176176
$taxes = $cart->get_subtotal_tax() + $cart->get_shipping_tax() - $cart->get_discount_tax();
177177
$total = $subtotal + $taxes;
@@ -190,7 +190,7 @@ protected function calculate_percentage_order(WC_Order $order, array $gatewaySet
190190
if (empty($gatewaySettings[Surcharge::PERCENTAGE])) {
191191
return 0.0;
192192
}
193-
$percentageFee = $gatewaySettings[Surcharge::PERCENTAGE];
193+
$percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE];
194194
$total = $order->get_total();
195195
$fee = $total * ($percentageFee / 100);
196196

src/PaymentMethods/Constants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ class Constants
1212
public const BANKTRANSFER = 'banktransfer';
1313

1414
public const BANCOMATPAY = 'bancomatpay';
15+
16+
public const ALMA = 'alma';
1517
}

0 commit comments

Comments
 (0)