-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
Describe the bug
adyen-magento2/Observer/BeforeShipmentObserver.php
Lines 167 to 177 in 0431f3b
| private function itemsToBeInvoiced(Shipment $shipment): array | |
| { | |
| $shipmentItems = $shipment->getItems(); | |
| $invoiceItems = []; | |
| foreach ($shipmentItems as $shipmentItem) { | |
| $invoiceItems[$shipmentItem->getOrderItemId()] = $shipmentItem->getQty(); | |
| } | |
| return $invoiceItems; | |
| } |
This code expects all items to ship, which is not the case for virtual products. This causes those items not to be invoiced leading to a partial (or failed) capture.
To Reproduce
Steps to reproduce the behavior:
- Place an order with both virtual and regular (simple) products
- Pay using an Open Invoice method (Klarna for example)
- Create a shipment
- Inspect the invoice and capture flow
Expected behavior
Items which do not require a shipment (e.g. virtual products) should be invoiced and captured.
Magento version
2.4.7-p3
Plugin version
9.6.0, but can be reproduced on the latest version (9.11.0) as well.
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels