adyen-magento2
adyen-magento2 copied to clipboard
[Bug]: idempotencyExtraData stays the same for buildPartialOrMultipleCaptureData request when the same amount is requested
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
- Install Adyen MAGENTO 2 v9.19.0
- Have Multiple Partial Capture enabled
- Your process needs to create capture requests on invoice
- Create an order with
quantity> 1 on the same SKU - Successfully receive the AUTHORISATION notification for the full amount
- Invoice/capture only 1 quantity of the SKU
- Successfully receive the CAPTURE notification for the 1 quantity amount
- again invoice/capture only 1 quantity of the SKU
- see that you didn't receive the CAPTURE notification and in the Order history that the pspReference is the same :
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