OkraDotNet 1.1.1
dotnet add package OkraDotNet --version 1.1.1
NuGet\Install-Package OkraDotNet -Version 1.1.1
<PackageReference Include="OkraDotNet" Version="1.1.1" />
paket add OkraDotNet --version 1.1.1
#r "nuget: OkraDotNet, 1.1.1"
// Install OkraDotNet as a Cake Addin
#addin nuget:?package=OkraDotNet&version=1.1.1
// Install OkraDotNet as a Cake Tool
#tool nuget:?package=OkraDotNet&version=1.1.1
Okra API wrapper for .Net
<img src="https://files.readme.io/5b62e80-small-circle-logo.png"/> This library provides a convenient way to consume the Okra.ng API from .Net projects.
How to Install
Via Visual Studio IDE
- On a new project, Navigate to the Solution Explorer tab within Visual Studio.
- Right-click on the References node and click on the Manage Nuget Packages from the resulting context menu.
- On the Nuget Package Manager window navigate to the Browse Tab.
- Key in OkraDotNet and select version 1.1.1 or higher.
- Click on the Install button and accept the licences to proceed. .
Via .NET CLI
- From the command prompt/powershell window opened in your project directory, key in the following and press Enter.
dotnet add package OkraDotNet --version 1.1.1
Ensure you have the latest version of the package. Visit Nuget for more info on the latest release of this package.
Via Nuget Package Manger Console
- On your Nuget package manager console,key in the following and press Enter
Install-Package OkraDotNet -Version 1.1.1
Ensure you have the latest version of the package. Visit Nuget for more info on the latest release of this package
Usage
The OkraApi class is an important type in this library . This can be created as follows:
- To use this package ensure you include the following
using
statement to your project file:
using OkraDotNet;
The package needs to be configured with your Okra.ng accessToken which you can get from your dashboard.
var accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
var isProduction = true;
var api = new OkraApi(accessToken, isProduction);
Auth API
To access the Auth API, use methods from the IAuthApi interface (available via the Auth property of OkraDotNet, viz:
//Retrieve Auth request
var response1 = api.RetrieveAuthAsync(new PaginatedRequest { Limit = 10, Page = 1 }).Result;
if (response1.IsSuccess)
{
RetrieveAuthResponseData data = response1.Value;
// do something with data
}
else
{
var error = response1.Error;
//use error
}
//Auth By id
var response2 = api.AuthByIdAsync(new AuthByIdRequest { Id = "5f338d5c9e5c6e823a71e5e1", Limit = 2, Page = 1 }).Result;
if (response2.IsSuccess)
{
AuthResponseData data = response2.Value;
// do something with data
}
else
{
var error = response2.Error;
//use error
}
The AuthApi is defined as follows:
public interface IAuthApi
{
Task<Result<AuthResponseData, OkraError>> AuthByBankAsync(AuthByBankRequest request);
Task<Result<AuthResponseData, OkraError>> AuthByCustomerAsync(AuthByCustomerRequest request);
Task<Result<AuthResponseData, OkraError>> AuthByCustomerAndDateAsync(AuthByCustomerAndDateRequest request);
Task<Result<AuthResponseData, OkraError>> AuthByDateAsync(AuthByDateRequest request);
Task<Result<AuthResponseData, OkraError>> AuthByIdAsync(AuthByIdRequest request);
Task<Result<RetrieveAuthResponseData, OkraError>> RetrieveAuthAsync(PaginatedRequest request);
Task<Result<string, OkraError>> RetrieveAuthAsPdfAsync(PaginatedRequest request);
Task<Result<AuthCallbackResponseData, OkraError>> AuthCallBackAsync(string record);
}
Version 1.1.1 Changes:
- Updated base URL to okra.ng V2 API.
- Added new constructor.
OkraApi(string accessToken, string baseApiUrl)
to
OkraApi class
This constructor sets the base URL and access token.
- Updated transaction API.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- CSharpFunctionalExtensions (>= 2.11.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.7)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.