Skip to content

Commit

Permalink
Merge pull request mollie#912 from mollie/release/7.5.3
Browse files Browse the repository at this point in the history
Release/7.5.4
  • Loading branch information
mmaymo authored Jun 3, 2024
2 parents 5c2a361 + 7e2bcb0 commit 7111a67
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mollie-payments-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Mollie Payments for WooCommerce
* Plugin URI: https://www.mollie.com
* Description: Accept payments in WooCommerce with the official Mollie plugin
* Version: 7.5.4-beta
* Version: 7.5.4
* Author: Mollie
* Author URI: https://www.mollie.com
* Requires at least: 5.0
Expand All @@ -12,7 +12,7 @@
* Domain Path: /languages
* License: GPLv2 or later
* WC requires at least: 3.9
* WC tested up to: 8.7
* WC tested up to: 8.9
* Requires PHP: 7.2
* Requires Plugins: woocommerce
*/
Expand Down
6 changes: 6 additions & 0 deletions src/Gateway/GatewayModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/Gateway/Surcharge.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected function calculate_percentage(WC_Cart $cart, array $gatewaySettings)
if (empty($gatewaySettings[Surcharge::PERCENTAGE])) {
return 0.0;
}
$percentageFee = $gatewaySettings[Surcharge::PERCENTAGE];
$percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE];
$subtotal = $cart->get_subtotal() + $cart->get_shipping_total() - $cart->get_discount_total();
$taxes = $cart->get_subtotal_tax() + $cart->get_shipping_tax() - $cart->get_discount_tax();
$total = $subtotal + $taxes;
Expand All @@ -190,7 +190,7 @@ protected function calculate_percentage_order(WC_Order $order, array $gatewaySet
if (empty($gatewaySettings[Surcharge::PERCENTAGE])) {
return 0.0;
}
$percentageFee = $gatewaySettings[Surcharge::PERCENTAGE];
$percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE];
$total = $order->get_total();
$fee = $total * ($percentageFee / 100);

Expand Down
2 changes: 2 additions & 0 deletions src/PaymentMethods/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ class Constants
public const BANKTRANSFER = 'banktransfer';

public const BANCOMATPAY = 'bancomatpay';

public const ALMA = 'alma';
}

0 comments on commit 7111a67

Please sign in to comment.