Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/7.5.4 #912

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
}
Loading