• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Adyen/adyen-dotnet-api-library: Adyen API Library for .NET

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(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 Library

nuget nuget .NET Core

This is the officially supported dotnet library for using Adyen's APIs.

Integration

The library supports all APIs under the following services:

  • Checkout API: Our latest integration for accepting online payments. Current supported version: v69
  • Payments API: Our classic integration for online payments. Current supported version: v51
  • Recurring API: Endpoints for managing saved payment details. Current supported version: v49
  • Payouts API: Endpoints for sending funds to your customers. Current supported version: v51
  • Adyen BinLookup API: Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version: v50
  • Utility API: This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. Current supported version: v67
  • Platforms APIs: Set of APIs when using Adyen for Platforms.
  • Cloud-based Terminal API: Our point-of-sale integration.
  • Local-based Terminal API: Our point-of-sale integration.
  • POS Terminal Management API: Endpoints for managing your point-of-sale payment terminals v1

For more information, refer to our documentation or the API Explorer.

Prerequisites

  • Adyen test account
  • API key. For testing, your API credential needs to have the API PCI Payments role.
  • Adyen dotnet API Library supports .net standard 2.0
  • In order for Adyen dotnet API Library to support local terminal api certificate validation the application should be set to .net core 2.1 and above or .net framework 4.6.1 and above

Installation

Simply 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 library

General use with API key

In 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 integration

For 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 tests

Navigate to adyen-dotnet-api-library folder and run the following commands.

dotnet build
dotnet test

Using the Cloud API for post

In 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);

Contributing

We 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.

Support

If you have a feature request, or spotted a bug or a technical problem, create an issue here.

For other questions, contact our Support Team.

Licence

This repository is available under the MIT license.

See also




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap