开源软件名称(OpenSource Name):Adyen/adyen-dotnet-api-library开源软件地址(OpenSource Url):https://github.com/Adyen/adyen-dotnet-api-library开源编程语言(OpenSource Language):C# 100.0%开源软件介绍(OpenSource Introduction):Adyen dotnet API LibraryThis is the officially supported dotnet library for using Adyen's APIs. IntegrationThe library supports all APIs under the following services:
For more information, refer to our documentation or the API Explorer. Prerequisites
InstallationSimply download and restore nuget packages https://www.nuget.org/packages/Adyen/ or install it from package manager PM> Install-Package Adyen -Version x.x.x Using the libraryGeneral use with API keyIn order to submit http request to Adyen API you need to initialize the client. The following example makes a checkout payment request: // Create a paymentsRequest
var amount = new Model.Checkout.Amount("USD", 1000);
var paymentRequest = new Model.Checkout.PaymentRequest
{
Reference = "Your order number",
Amount = amount,
ReturnUrl = @"https://your-company.com/...",
MerchantAccount = ClientConstants.MerchantAccount,
};
paymentRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith");
//Create the http client
var client = new Client("YOUR-XAPI-KEY", Model.Enum.Environment.Test);//or Model.Enum.Environment.Live
var checkout = new Checkout(client);
//Make the call to the service. This example code makes a call to /payments
var paymentResponse = checkout.Payments(paymentRequest); Example integrationFor a closer look at how our dotnet library works, clone our ASP .net example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. Running the testsNavigate to adyen-dotnet-api-library folder and run the following commands. dotnet build
dotnet test Using the Cloud API for postIn order to submit POS request with Cloud API you need to initialize the client with the Endpoints that it is closer to your region. The Endpoints are available as contacts in ClientConfig For more information please read our documentation //Example for EU based Endpoint Syncronous
var config = new Config
{
XApiKey = "Your merchant XAPI key",
CloudApiEndPoint = ClientConfig.CloudApiEndPointEULive
};
var client = new Client(config); ContributingWe encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our contributing guidelines to find out how to raise a pull request. SupportIf you have a feature request, or spotted a bug or a technical problem, create an issue here. For other questions, contact our Support Team. LicenceThis repository is available under the MIT license. See also |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论