adyen-magento2 icon indicating copy to clipboard operation
adyen-magento2 copied to clipboard

[Bug]: idempotencyExtraData stays the same for buildPartialOrMultipleCaptureData request when the same amount is requested

Open Dnd-Nap opened this issue 5 months ago • 0 comments

Description

We found out that if the multiple partial capture is enabled, and if we attempt to capture the same amount twice, the first capture will be processed normally and a notification will be created, but the second time the capture is never received because the idempotencyExtraData is exactly the same.

Steps to reproduce

  1. Install Adyen MAGENTO 2 v9.19.0
  2. Have Multiple Partial Capture enabled
  3. Your process needs to create capture requests on invoice
  4. Create an order with quantity > 1 on the same SKU
  5. Successfully receive the AUTHORISATION notification for the full amount
  6. Invoice/capture only 1 quantity of the SKU
  7. Successfully receive the CAPTURE notification for the 1 quantity amount
  8. again invoice/capture only 1 quantity of the SKU
  9. see that you didn't receive the CAPTURE notification and in the Order history that the pspReference is the same :
Image

Actual behavior

The unexpected behavior is that the received response for the second partial capture request is exactly the same as the previous one. No new capture notifications will be received.

The idempotencyExtraData in the capture request will be exactly the same as the previous one because the total_captured field in adyen_order_payment table stays at 0 thus the idempotencyExtraData becomes useless when the same amount is requested on the same order.

Expected behavior

We should receive a new capture notification even if we request the same amount twice on the same order.

Code snippet or screenshots (if applicable)

see https://github.com/Adyen/adyen-magento2/blob/v9.19.0/Gateway/Request/CaptureDataBuilder.php#L183

Adyen Magento Plugin version

9.19.0

Magento version

2.4.7-p5

Operating System

None

Browser (if applicable)

No response

Additional context and logs

No response

Dnd-Nap avatar Jun 26 '25 15:06 Dnd-Nap