Adyen / adyen-node-api-library

Adyen API Library for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Error Response In case Referenced Refund from another device

ItsQasim opened this issue · comments

Describe the bug
Can not complete a refund when we are using a different payment device for the referenced refund

To Reproduce

  1. Do a simple payment transaction from a payment device e285p (device 1)
  2. Do a referenced refund of above transaction from another payment device e285p (device 2)

Expected behavior
Refund should be done

Screenshots
Got following response
"ReversalResponse": {
"Response": {
"AdditionalResponse": "message=Original%20currency%20not%20found%20and%20none%20given",
"ErrorCondition": "UnavailableService",
"Result": "Failure"
}
}

Desktop (please complete the following information):

  • OS: [Windows]
  • Node Version: [14.0.14]
  • NPM Version: [6.14.14]

Additional context
I have gone through the Adyen documentation but couldn't find enough information for these kind of scenarios. This issue is only reproducible when we use a different payment device for the referenced refund. My understanding is that when we request a referenced refund from a payment device [Not the same payment device which was used for the original payment] then Adyen backend is not able to get enough information about the original payment transaction like the original currency as you can see the above error message from Adyen.
Anyhow, I got a little help from https://docs.adyen.com/point-of-sale/refund-payment/referenced#refund-ecommerce-payment section and populate the SaleData object with relevant information and that was working in my case.

Suggestion: Either you can treat this as a bug because the referenced refund request is working fine if we use only one payment device for both Sale payment and Refund Payment, but the same request is causing the issue if we use another payment device for the referenced refund, or you can add some documentation with a sample request by populating the SaleData object, as I did.

@ItsQasim,

Thanks for reaching out to us with this issue. This problem seems to be more related to something on api level than library sided really. Therefore, I will have to discuss this internally with the people responsible for this API and will get back to you on this. I'm sure they will appreciate to hear about this issue though, since it seems like quite an edge case implementation but warranted nevertheless .

Best, Jilling
Adyen

I have investigated this issue on my end. While doing the referenced refund, I only sent the refund amount but not the currency code and it was working fine on the same device (e285p) because this device can store the N (don't know the exact count) number of transactions in it, so between that time period untill that transaction discarded from the cache of that device, when we do the referenced refund of the original payment then that device has already information like currency etc. about the original payment. But in case of other device, if we use that for the referenced refund, it causes the issue because that other device does not have any information about the original payment transaction.
So technically, This is not a bug but you guys need to add some documentation around this on your website. And that is my understanding related to this issue but I would also love to hear your side of story. @jillingk

Regards
Qasim

Hi @ItsQasim,

I sent your issue to our POS team and it seems indeed that it's not a bug perse but more of a bit of an indistinct functionality. They indeed confirmed that since you're sending a reversal request with amount and without specifying currency on one device, you cannot infer currency on another. This is specifically designed like that because the tx is in fact on the other terminal. Hope this helps a little. We will be sure to adjust/expand our documentation on this!

Best, Jilling
Adyen