ACSD-58383 Adobe Commerce patch: Duplicate credit memos from simultaneous refund requests via REST API

The ACSD-58383 patch fixes the issue where issuing a refund via the REST API with two identical requests that are executed simultaneously, results in duplicate credit memos.

This patch is available when the Quality Patches Tool (QPT) 1.1.55 is installed. The patch ID is ACSD-58383. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.8.

Affected products and versions

The patch is created for Adobe Commerce version:

Adobe Commerce (all deployment methods) 2.4.6

Compatible with Adobe Commerce versions:

Adobe Commerce (all deployment methods) 2.4.4 - 2.4.7-p3

NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the 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

Duplicate credit memos result from two refunds created at the same time.

Steps to reproduce:

  1. Configure Paypal Express in the Commerce Admin.
  2. Set payment action to Sale.
  3. Configure the PayPal IPN (Instant Payment Notification) on the PayPal Sandbox website.
  4. Issue refund on the PayPal Sandbox website.
  5. Emulate an IPN message from PayPal using developer tools. IPN must create a credit memo.
  6. Create a second credit memo using an API call.

Expected results:

Only one credit memo is created for the same item.

Actual results:

Two credit memos are created for the same item.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3