C# SDK
Install and start using the C# SDK.
Intro
The Adyen Checkout API SDK provides access to the Adyen Checkout API REST APIs.
Adyen Checkout API
Installation
Add the SDK as a project reference into your solution:
dotnet add reference <path-to-sdk>/AdyenCheckoutApi.csprojQuick Start
Dependency Injection
Register the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through AdyenCheckoutApiClientOptions.
services.AddAdyenCheckoutApiClient(options =>
{
options.BasicAuth = new BasicAuthCredentials { Username = "YOUR_USERNAME", Password = "YOUR_PASSWORD" };
options.ApiKeyAuth = "YOUR_API_KEY";
options.Environment = ServerEnvironment.Production;
// TODO: configure more client options here
});Direct Instantiation
Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through AdyenCheckoutApiClientOptions.
var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new AdyenCheckoutApiClientOptions
{
BasicAuth = new BasicAuthCredentials { Username = "YOUR_USERNAME", Password = "YOUR_PASSWORD" },
ApiKeyAuth = "YOUR_API_KEY",
Environment = ServerEnvironment.Production,
};
var client = new AdyenCheckoutApiClient(httpClient, options);