From 188f2b807c6812e79c48f45daa9641a2eb56600f Mon Sep 17 00:00:00 2001 From: "g.prenaj" Date: Tue, 17 Mar 2026 16:39:40 +0100 Subject: [PATCH] FIX : Payment fee is still charged --- src/Handlers/PaymentHandlerLegacy.php | 3 ++- src/Handlers/PaymentHandlerModern.php | 3 ++- src/Handlers/PaymentHandlerSimple.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Handlers/PaymentHandlerLegacy.php b/src/Handlers/PaymentHandlerLegacy.php index 879cb378..742f336d 100644 --- a/src/Handlers/PaymentHandlerLegacy.php +++ b/src/Handlers/PaymentHandlerLegacy.php @@ -65,7 +65,8 @@ public function pay( $paymentCode, $salesChannelId ); - if ($fee > 0) { + $existingFee = (float) ($order->getCustomFieldsValue('buckarooFee') ?? 0.0); + if ($fee > 0 || $existingFee > 0) { $this->asyncPaymentService ->checkoutHelper ->applyFeeToOrder($order->getId(), $fee, $salesChannelContext->getContext()); diff --git a/src/Handlers/PaymentHandlerModern.php b/src/Handlers/PaymentHandlerModern.php index e3668d3a..92b8e715 100644 --- a/src/Handlers/PaymentHandlerModern.php +++ b/src/Handlers/PaymentHandlerModern.php @@ -97,7 +97,8 @@ public function pay( $paymentCode, $order->getSalesChannelId() ); - if ($fee > 0) { + $existingFee = (float) ($order->getCustomFieldsValue('buckarooFee') ?? 0.0); + if ($fee > 0 || $existingFee > 0) { $this->feeCalculator->applyFeeToOrder($order->getId(), $fee, $salesChannelContext->getContext()); // Reload order to get updated total $reloadedOrder = $this->asyncPaymentService->checkoutHelper->getOrderById( diff --git a/src/Handlers/PaymentHandlerSimple.php b/src/Handlers/PaymentHandlerSimple.php index af1ffdac..103aa3ee 100644 --- a/src/Handlers/PaymentHandlerSimple.php +++ b/src/Handlers/PaymentHandlerSimple.php @@ -268,7 +268,8 @@ public function pay( $paymentCode, $salesChannelContext->getSalesChannelId() ); - if ($fee > 0) { + $existingFee = (float) ($order->getCustomFieldsValue('buckarooFee') ?? 0.0); + if ($fee > 0 || $existingFee > 0) { $feeCalculator->applyFeeToOrder($order->getId(), $fee, $context); // Reload order to get updated total $order = $this->asyncPaymentService->checkoutHelper->getOrderById($order->getId(), $context);