Adyen / adyen-dotnet-api-library

Adyen API Library for .NET
MIT License
108 stars 112 forks source link

AdjustAuthorisation response fails to parse. #1017

Open DevenKHare opened 6 months ago

DevenKHare commented 6 months ago

Describe the bug An exception is thrown when calling Service.PaymentService.AdjustAuthorisation

"Error converting value ""Authorised"" to type 'Adyen.Model.Payment.ModificationResult+ResponseEnum'"

The response object Adyen.Model.Payment.ModificationResult has a Reponse property of type ResponseEnum. The ResponseEnum does not have an enum for "Authorised" causing the conversation from the JSON to fail with the exception.

To Reproduce Create a PreAuth payment. Modify the PreAuth payment using Service.PaymentService.AdjustAuthorisation

Expected behavior The expected behavior is Service.PaymentService.AdjustAuthorisation to return an Adyen.Model.Payment.ModificationResult object and not throw an exception trying to parse the result that is returned.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): Windows 10, running a windows form app .Net framework 4.6.2

Additional context Synchronous call to [https://pal-test.adyen.com/pal/servlet/Payment/v68/adjustAuthorisation] Request { "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "originalReference":"KHQC5N7G84BLNK43", "modificationAmount": { "currency": "USD", "value": 8677 }, "reference": "123456", "additionalData":{ "adjustAuthorisationData":"BQABAQ..." } } And response { "additionalData": { "authCode": "032955", "adjustAuthorisationData": "BQABAQ...", "refusalReasonRaw": "AUTHORISED" }, "pspReference": "NC6HT9CRT65ZGN82", "response": "Authorised" }

DjoykeAbyah commented 1 week ago

Hi @DevenKHare,

Apologies for the delayed response. I wanted to let you know that our latest release includes the addition of the Authorised field in ModificationResult.

Kind regards, Djoyke Adyen