Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright 2016 Adobe
* Copyright 2026 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);
Expand Down Expand Up @@ -133,7 +133,7 @@ private function validateTotalQuantityRefundable(
}
$orderItem = $orderItemsById[$item->getOrderItemId()];

if (!$this->isValidDecimalRefundQty($orderItem->getIsQtyDecimal(), $item->getQty())) {
if (!$this->isValidDecimalRefundQty($orderItem->getIsQtyDecimal(), (float)$item->getQty())) {
return __(
'We found an invalid quantity to refund item "%1".',
$orderItem->getSku()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,28 @@ public static function dataProviderForValidateQty()
'expected' => [],
'isQtyDecimalAllowed' => false,
'isAllowZeroGrandTotal' => true
],
[
'orderId' => 1,
'orderItemId' => 1,
'qtyToRequest' => '1.0',
'qtyToRefund' => 1,
'sku' => 'sku',
'total' => 15,
'expected' => [],
'isQtyDecimalAllowed' => false,
'isAllowZeroGrandTotal' => true
],
[
'orderId' => 1,
'orderItemId' => 1,
'qtyToRequest' => '2.5',
'qtyToRefund' => 3,
'sku' => 'sku',
'total' => 15,
'expected' => [],
'isQtyDecimalAllowed' => true,
'isAllowZeroGrandTotal' => true
]
];
}
Expand Down