AmazonPayHttpClient 1.0.1
dotnet add package AmazonPayHttpClient --version 1.0.1
NuGet\Install-Package AmazonPayHttpClient -Version 1.0.1
<PackageReference Include="AmazonPayHttpClient" Version="1.0.1" />
paket add AmazonPayHttpClient --version 1.0.1
#r "nuget: AmazonPayHttpClient, 1.0.1"
// Install AmazonPayHttpClient as a Cake Addin #addin nuget:?package=AmazonPayHttpClient&version=1.0.1 // Install AmazonPayHttpClient as a Cake Tool #tool nuget:?package=AmazonPayHttpClient&version=1.0.1
Intro
AmazonPayLib is a package used for access Amazon Pay Onetime checkout V2 https://developer.amazon.com/docs/amazon-pay/intro.html through HttpClient
No additional dependency
Basic usage
All interfaces typically is generic with two paramameters
IPublicKeyProvider interface retrieve your own public key. You should inherit from it and realize.
IPrivateKeyProvider interface retrieve your own private key. You should inherit from it and realize.
Use with clear HttpClient
Install nuget pacjage AmazonPayHttpClient
Make inheritance from IPrivateKeyProvider IPublicKeyProvider
Use with serviceCollection
Just call AddAmazonPay Extension, and configure your HttpClient by calling ConfigureAmazonPayFor* methods
ConfigureAmazonPayForUnitedStates ConfigureAmazonPayForEurope ConfigureAmazonPayForJapan
Now you can create HttpClient to your code with HttpClientFactory
HttpClient without HttpClientFactory
Just call AmazonHttpClientFactory.CreateForUnitedStates, AmazonHttpClientFactory.CreateForJapan, AmazonHttpClientFactory.CreateForEurope
methods
payload signing
Ones initializing amazon pay on frontend you should send payload and signing to amazon.
Use ISignatureClient interface for it. It added by Add HttpClient to ServiceCollection or you can create it by call SignatureClientFactory.Create
Typing contracts
nuget package AmazonPayHttpClient.Contracts contains classes that marked for use with System.Text.json
Refit интерфейс
nuget package AmazonPayHttpClient.Refit contains interface for Refit.
Call AddAmazonPayRefitClientFor* extension or create it directly
AmazonPayClient.ForEurope, AmazonPayClient.ForJapan, AmazonPayClient.ForUnitedStates
Newtosoft serialzation
nuget package AmazonPayHttpClient.Refit.Newtonsoft contains interface for Refit that use Newtonsoft.Json. nuget package AmazonPayHttpClient.Contracts.Newtonsoft contains class marked for use with Newtosoft.Json
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on AmazonPayHttpClient:
Package | Downloads |
---|---|
AmazonPayHttpClient.Refit
Refit interface for AmazonPayHttpClient nuget-package. |
|
AmazonPayHttpClient.Refit.Newtonsoft
Refit interface for AmazonPayHttpClient nuget-package with Newtonsoft Json serializer. |
GitHub repositories
This package is not used by any popular GitHub repositories.