-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Authorise recurring payment with Client-Side Encryption fails: Unprocessable Entity #2
Comments
Hello @Jarrich, Thank you for adding the issue. I tried to reproduce it and the json parser handles the additional data property properly. Furthermore, In order to test the JsonSerializer I added a create additional data method in BaseTest class which is used by TestAuthoriseSuccessMockedResponse. {"card":{"number":"xxxxxxxxxxxxxxxxx","cvc":"123","holderName":"John Smith","expiryMonth":"08","expiryYear":"2018"}, The same JsonSerializer is used everywhere in the library. Thank you in advance, |
Hi Alexandros, Is it possible that the published NuGet is out of date? On GitHub i can see that the AdditionalData property is a Dictionary in the PaymentRequest class; whereas when I add the NuGet to my project; the AdditionalData property on PaymentRequest model is a KeyValuePair (which would explain my test results that I describe below) I reproduced the issue in a brand new, empty .NET Core console application; after adding the Adyen.EcommLibrary NuGet My code: `var username = "xxxx";
When I inspect the call made to Adyen using Fiddler; I see the following JSON payload:
Error returned: 422 Unprocessable Entity When I replace
With the expected
The response is 200 OK; resultCode Authorized. Additionally; I'm wondering why the Contract in the JSON body still mentions ONECLICK when I specifically indicate I want RECURRING in my .NET application. |
Hello @Jarrich The issue with the additional data is fixed and published on nuget. You can download the 1.0.2 version. kind regards, |
Sorry for being late. The new NuGet seems to work. |
@Jarrich Thank you for the confirmation. |
When trying to authorize a recurring payment using Client-Side Encryption; the request fails due to an Unprocessable Entity.
The expected JSON to be sent to Adyen /authorize endpoint in this case would be
{"amount":{"currency":"USD","value":0},"reference":"xxxxx","shopperIp":"xxxxx","merchantAccount":"xxxxx","shopperEmail":"xxxxxxx","shopperReference":"xxxxxxx","recurring":{"contract":"RECURRING"},"additionalData":{"card.encrypted.json": "adyenjs_0_1_19$xxxxxxx"}}
But instead we get:
{"amount":{"currency":"USD","value":0},"reference":"xxxxx","shopperIp":"xxxxx","merchantAccount":"xxxxx","shopperEmail":"xxxxxxx","shopperReference":"xxxxxxx","recurring":{"contract":"RECURRING"},"additionalData":{"Key":"card.encrypted.json","Value":"adyenjs_0_1_19$xxxxxxx"}}
Because the AdditionalData is implemented as a KeyValuePair and the underlying JsonSerializer produces the wrong output in this scenario ("Key": xxx, "Value": xxxx)
Additionally; I believe the AdditionalData property on the PaymentRequest model should accept multiple key/value pairs; since it's normally possible to pass more than 1 "additional data" (see https://docs.adyen.com/developers/risk-management/skip-risk-checks )
The text was updated successfully, but these errors were encountered: