From e0cf084f3779f1ed0af3f1a4563d5c61a19d61ba Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Tue, 24 Oct 2023 14:05:12 +0200 Subject: [PATCH 1/2] Check if the Payment Fee is available before calculating --- Plugin/Tax/Helper/Data.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Plugin/Tax/Helper/Data.php b/Plugin/Tax/Helper/Data.php index 46c8e01a979..4dab1a67857 100644 --- a/Plugin/Tax/Helper/Data.php +++ b/Plugin/Tax/Helper/Data.php @@ -58,10 +58,20 @@ public function afterGetCalculatedTaxes(Subject $subject, array $result, $source $this->result = $result; $order = $source->getOrder(); + if (!$order->getPayment() || + strstr($order->getPayment()->getMethod(), 'mollie_methods_') === false + ) { + return $result; + } + $amount = $order->getMolliePaymentFee(); $taxAmount = $order->getMolliePaymentFeeTax(); $baseTaxAmount = $order->getMolliePaymentFee(); - $rate = round(($taxAmount / $amount) * 100); + + $rate = 0; + if ((float)$order->getMolliePaymentFeeTax()) { + $rate = round(($taxAmount / $amount) * 100); + } $taxClassId = $this->config->paymentSurchargeTaxClass( $order->getPayment()->getMethod(), From e411130fdb456d5a766c713a7c8a939bcff3f0d9 Mon Sep 17 00:00:00 2001 From: Marvin Besselsen Date: Tue, 24 Oct 2023 14:31:41 +0200 Subject: [PATCH 2/2] Version bump --- composer.json | 2 +- etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b3836ef75b0..17cbd0e3ad2 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "mollie/magento2", "description": "Mollie Payment Module for Magento 2", - "version": "2.32.0", + "version": "2.32.1", "keywords": [ "mollie", "payment", diff --git a/etc/config.xml b/etc/config.xml index 7bdeda35b6f..d08d74ed199 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -3,7 +3,7 @@ - v2.32.0 + v2.32.1 0 0 test