Skip to content
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
3 changes: 2 additions & 1 deletion src/Handlers/PaymentHandlerLegacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion src/Handlers/PaymentHandlerModern.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
$paymentCode,
$order->getSalesChannelId()
);
if ($fee > 0) {
$existingFee = (float) ($order->getCustomFieldsValue('buckarooFee') ?? 0.0);

Check failure on line 100 in src/Handlers/PaymentHandlerModern.php

View workflow job for this annotation

GitHub Actions / Code Quality

Cannot cast mixed to float.
if ($fee > 0 || $existingFee > 0) {
$this->feeCalculator->applyFeeToOrder($order->getId(), $fee, $salesChannelContext->getContext());
// Reload order to get updated total
$reloadedOrder = $this->asyncPaymentService->checkoutHelper->getOrderById(
Expand Down
3 changes: 2 additions & 1 deletion src/Handlers/PaymentHandlerSimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
$paymentCode,
$salesChannelContext->getSalesChannelId()
);
if ($fee > 0) {
$existingFee = (float) ($order->getCustomFieldsValue('buckarooFee') ?? 0.0);

Check failure on line 271 in src/Handlers/PaymentHandlerSimple.php

View workflow job for this annotation

GitHub Actions / Code Quality

Cannot cast mixed to float.
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);
Expand Down
Loading