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);