Adyen / adyen-magento2

Adyen Payment plugin for Magento2
MIT License
155 stars 211 forks source link

Full refund issued when partial refund requested in 7.0.0-rc2 #976

Closed davie closed 3 years ago

davie commented 3 years ago

Describe the bug A partial refund was issued from magento, shows as requesting a partial refund in the notes, but actually requests a full refund, and confirms processing of a full refund. Eg full order for 4,454.50 GBP refund for 32.00 GBP results in a refund in adyen for 4,454.50 GBP

To Reproduce Steps to reproduce the behavior:

  1. Create a paid for order in magento with multiple items
  2. Click on the invoice.
  3. Click on Credit memo
  4. Change quantity to refund to 1, so only 1 of the items is refunded.
  5. Note that the comment on the order shows it requesting the correct amount for 1 item
  6. wait for the notification from adyen - it show a refund for the full amount (which is not correct).
  7. check the adyen info logs - the wrong, full, amount appears to have been requested from the adyen magento plugin

Expected behavior The correct, partial amount of 32 GBP being refunded, on this example it is over by 4422.5 GBP.

Magento version 2.3.6

Plugin version 7.0.0rc2

Screenshots

Desktop (please complete the following information): n/a

Smartphone (please complete the following information): n/a

Additional context see details from a test transaction showing this issue in the test environment.

magento comments:

Mar 4, 2021 12:16:04 PM Processing Customer Not Notified
Adyen HTTP Notification(s):
eventCode: REFUND
pspReference: 863614859579102E
paymentMethod: mc
success: true
Mar 4, 2021 12:06:19 PM Processing Customer Not Notified
We refunded £8.01 online. Transaction ID: "853614859422773C-refund"
Mar 4, 2021 12:06:19 PM Processing Customer Not Notified
Adyen Result response:
authResult: [refund-received]
pspReference: 863614859579102E
Mar 4, 2021 12:05:06 PM Processing Customer Not Notified
Adyen Payment Successfully completed
Mar 4, 2021 12:05:06 PM Processing Customer Not Notified
Payment is authorised waiting for capture
Mar 4, 2021 12:05:06 PM Payment Review Customer Not Notified
Adyen HTTP Notification(s):
eventCode: AUTHORISATION
pspReference: 853614859422773C
paymentMethod: mc
success: true
reason:082146:5454:03/2030
Mar 4, 2021 12:03:43 PM Payment Review Customer Not Notified
We will authorize £8.03 after the payment is approved at the payment gateway.
Mar 4, 2021 12:03:43 PM Customer Not Notified
Adyen Result response:
authResult: IdentifyShopper

adyen details:

Payment 000015062   SentForRefund   GBP 8.03    2021-03-04 13:03:50 CET ws@Company.XXXXLTD  7F6E55LEB4O     
sub Capture <auto>  SentForSettle   GBP 8.03    2021-03-04 13:04:03 CET         arn1614859443131    
sub Refund  000015062   SentForRefund   GBP -8.03   2021-03-04 13:07:01 CET ws@Company.XXXXLTD      arn1614859621953    

adyen info log: [2021-03-04 12:06:19] AdyenLoggerTest.INFO: JSON Request to Adyen:{"modificationAmount":{"currency":"GBP","value":803},"reference":"000015062","originalReference":"853614859422773C","merchantAccount":"XXXXLTDECOM","applicationInfo":{"adyenLibrary":{"name":"adyen-php-api-library","version":"8.1.0"},"adyenPaymentSource":{"version":"7.0.0-rc.2","name":"adyen-magento2"},"externalPlatform":{"version":"2.3.6","name":"Magento"}}} {"is_exception":false} []

acampos1916 commented 3 years ago

Hello @davie,

The fix is being introduced in #978.

Ángel

davie commented 3 years ago

thanks @acampos1916 I've just added a comment there - I think that change would fix this issue, but it looks like it would break refunds for split payments.

AlexandrosMor commented 3 years ago

Hello @davie The fix was introduced in the pr #978 so there are no more steps for us on this issue. If you have a new issue feel free to open a new github issue.

kind regards, Alexandros Adyen