Skip to content

The official Dojo .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+.

License

Notifications You must be signed in to change notification settings

dojo-engineering/Dojo.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dojo.Net

NuGet

The official Dojo .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+.

Installation

Using the .NET Core command-line interface (CLI) tools:

dotnet add package Dojo.Net

Using the NuGet Command Line Interface (CLI):

nuget install Dojo.Net

Using the Package Manager Console:

Install-Package Dojo.Net

From within Visual Studio:

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages...
  4. Click on the Browse tab and search for "Dojo.Net".
  5. Click on the Dojo.Net package, select the appropriate version in the right-tab and click Install.

Build source code

In order to build, NET30+ is required. Do the following:

  1. Go to src subfolder
  2. Run:
dotnet build

Documentation

For a comprehensive list of APIs and examples, check out the API documentation.

Usage

Dojo.Net.PaymentIntentsClient client = new PaymentIntentsClient(
    new HttpClient(),
    new ApiKeyClientAuthorization(apiKey));

Use it as .net service

builder.Services.AddSingleton<IClientAuthorization>(new ApiKeyClientAuthorization(apiKey));
builder.Services.AddHttpClient<IPaymentIntentsClient, PaymentIntentsClient>();

Automatic retries

The library does not automatically retries requests on intermittent failures like on a connection error. We suggest you use Polly library to setup retry policy.

builder.Services
    .AddHttpClient<IPaymentIntentsClient, PaymentIntentsClient>()
    .AddTransientHttpErrorPolicy(
        x => x.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(3, retryAttempt))));

For any requests, bug or comments, please open an issue or submit a pull request.