MDVA-35356: Wrong store credit return after canceling partially invoiced order
The MDVA-35356 patch fixes the issue with incorrect store credit return after partially invoiced order cancellation. This patch is available when the Quality Patches Tool (QPT) 1.0.19 is installed. The patch ID is MDVA-35356. Please note that the issue was fixed in Adobe Commerce version 2.4.3.
Affected products and versions
The patch is created for Adobe Commerce version:
Adobe Commerce on cloud infrastructure 2.4.1
Compatible with Adobe Commerce versions:
Adobe Commerce (all deployment methods) 2.3.0-2.4.2
magento/quality-patches
package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
Steps to reproduce:
-
Create three simple products.
-
Create a new user and assign store credit (Example: store credit = $10, simple product prices = $100, $200, and $300).
-
Log in 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:
code language-php //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 canceled.
-
Observe the store credit balance.
Expected results:
The store credit balance is still 0 because the $10 store credit has been invoiced.
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 deployment method:
- Adobe Commerce or Magento Open Source on-premises: Software Update Guide > Apply Patches in our developer documentation.
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in our developer documentation.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool released: a new tool to self-serve quality patches in our support knowledge base.
- Check if patch is available for your Adobe Commerce issue using Quality Patches Tool in our support knowledge base.
For info about other patches available in QPT, refer to Patches available in QPT in our developer documentation.