The MDVA-35356 Magento patch fixes the issue with incorrect store credit return after partially invoiced order cancellation.
This patch is available when the Magento Quality Patch (MQP) tool 1.0.19 is installed. The patch ID is MDVA-35356. Please note that the issue is scheduled to be fixed in Magento version 2.4.3.
Affected products and versions
The patch is created for Magento version:
Magento Commerce Cloud 2.4.1
Compatible with Magento versions:
Magento Commerce and Magneto Commerce Cloud 2.3.0-2.4.2
Note: the patch can be applicable to other versions. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
Steps to reproduce:
- Create 3 simple products.
- Create a new user and assign store credit (Example: store credit = $10, simple product prices = $100, $200, and $300).
- Login with the above user, and add the three products to the cart.
- Check out the three products in the cart, and utilize the store credit for a portion of the order (Example: paid with Check/Money order).
- Perform two invoices on the order through the API, one for Product 1 and one for Product 2:
//endpoint POST {\{baseUrl}}/V1/order/:orderId/invoice //1st API call: { "capture": true, "items": [ { "order_item_id": 1, "qty": 1 } ], "notify": true, "appendComment": false } //2nd API call: { "capture": true, "items": [ { "order_item_id": 2, "qty": 1 } ], "notify": true, "appendComment": false }
- Notice that the store credit is fully applied to the first invoice.
- Notice that the store credit balance = 0.
- Cancel the order, and see that two items are invoiced, and that the third item is cancelled.
- Observe the store credit balance.
Expected results:
The store credit balance is still 0 because the $10 of store credit have been invoiced, as expected.
Actual results:
The full store credit is returned: the balance is $10.
Apply the patch
To apply individual patches use the following links depending on your Magento product:
- Magento Commerce: DevDocs Software Update Guide > Apply Patches.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply Patches.
Related reading
To learn more about Magento Quality Patches, refer to:
- Magento Quality Patches released: a new tool to self-serve quality patches.
- Check patch for Magento issue with Magento Quality Patches.
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.