Search code examples
c#.netpaymentadyen

Integrating Adyen in .Net, getting Unauthorized response


I am trying to integrate Adyen in a .net application. Downloaded the sample code from their Github repository and hardcoded the api-key, merchant and client keys in the code to make sure they are getting populated.

Running the code from my localhost

I am getting this error {"status":401,"errorCode":"000","message":"HTTP Status Response - Unauthorized","errorType":"security"}

at this line: var res = _checkout.Sessions(sessionsRequest);

Sample code is here https://github.com/adyen-examples/adyen-dotnet-online-payments

Any idea of what I am missing?, anyone faced the same issue? Thanks!


Solution

  • Thank you, i was able to get successful calls after checking how those keys are set to the environment variables. Also Client key is important.