https://github.com/dojo-engineering/dojo.net
The official Dojo .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+.
https://github.com/dojo-engineering/dojo.net
csharp dotnet dotnet-core dotnetcore
Last synced: 9 months ago
JSON representation
The official Dojo .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+.
- Host: GitHub
- URL: https://github.com/dojo-engineering/dojo.net
- Owner: dojo-engineering
- License: mit
- Created: 2022-04-22T13:00:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T16:39:30.000Z (over 1 year ago)
- Last Synced: 2025-09-28T02:27:54.556Z (9 months ago)
- Topics: csharp, dotnet, dotnet-core, dotnetcore
- Language: Liquid
- Homepage:
- Size: 106 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Dojo.Net
[](https://www.nuget.org/packages/Dojo.net/)
The official [Dojo][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-core-cli-tools]:
```sh
dotnet add package Dojo.Net
```
Using the [NuGet Command Line Interface (CLI)][nuget-cli]:
```sh
nuget install Dojo.Net
```
Using the [Package Manager Console][package-manager-console]:
```powershell
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:
```sh
dotnet build
```
## Documentation
For a comprehensive list of APIs and examples, check out the [API
documentation][api-docs].
## Usage
```c#
Dojo.Net.PaymentIntentsClient client = new PaymentIntentsClient(
new HttpClient(),
new ApiKeyClientAuthorization(apiKey));
```
### Use it as .net service
```c#
builder.Services.AddSingleton(new ApiKeyClientAuthorization(apiKey));
builder.Services.AddHttpClient();
```
### Automatic retries
The library does not automatically retries requests on intermittent failures like on a
connection error. We suggest you use [Polly][polly] library to setup retry policy.
```c#
builder.Services
.AddHttpClient()
.AddTransientHttpErrorPolicy(
x => x.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(3, retryAttempt))));
```
For any requests, bug or comments, please [open an issue][issues] or [submit a
pull request][pulls].
[api-docs]: https://docs.dojo.tech/payments/api
[dotnet-core-cli-tools]: https://docs.microsoft.com/en-us/dotnet/core/tools/
[issues]: https://github.com/dojo-engineering/Dojo.Net/issues
[nuget-cli]: https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference
[package-manager-console]: https://docs.microsoft.com/en-us/nuget/tools/package-manager-console
[pulls]: https://github.com/dojo-engineering/Dojo.Net/pulls
[dojo]: https://dojo.tech
[polly]: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/implement-http-call-retries-exponential-backoff-polly