Tamara.SDK
1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Tamara.SDK --version 1.0.0
NuGet\Install-Package Tamara.SDK -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tamara.SDK" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tamara.SDK --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tamara.SDK, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Tamara.SDK as a Cake Addin
#addin nuget:?package=Tamara.SDK&version=1.0.0
// Install Tamara.SDK as a Cake Tool
#tool nuget:?package=Tamara.SDK&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DotNet SDK
Tamara .NET SDK is a wrapper for the Tamara API.
Installation
There are two ways to install Tamara .Net SDK in Publish folder:
- Reference your project to Tamara.Net.ClientSDK.dll
- Install nuget package 'Tamara_Client_NetSDK.1.0.0.nupkg' with offline mode
Usage
There are two ways:
1. Use factory
- Create a ApiConfiguration instance
- Create a Logger instance
var apiConfiguration = new ApiConfiguration();
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(AppContext.BaseDirectory))
.AddJsonFile("appsettings.json", optional: true);
IConfiguration configuation = builder.Build();
configuation.GetSection("tamaraPayment").Bind(apiConfiguration);
var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddLog4Net(new Log4NetProviderOptions()
{
Name = "TamaraApiClient",
Log4NetConfigFileName = "App_Data/log4net.xml"
});
});
var logger = loggerFactory.CreateLogger<ClientTest>();
_apiClient = CheckoutServiceFactory.CreateClient(apiConfiguration, logger);
2. Use dependency injection
ApiConfiguration & Logger were created as the same way above.
services.AddScoped<ITamaraApiClient, TamaraApiClient>(provider => new TamaraApiClient(apiConfiguration, logger));
Notification Service
1. Register notification service
services.AddScoped<ITammaraNotificationService, TamaraNotificationService>(provider => new TamaraNotificationService(apiConfiguration.NotificationPrivateKey, logger));
2. Create a controller to receive notification from Tamara
[HttpPost]
public async Task<IActionResult> ReceiveAuthoriseNotification()
{
var request = HttpContext.Request;
var result = await _tammaraNotificationService.ProcessAuthoriseNotification(request);
return Json(result);
}
[HttpPost]
public async Task<IActionResult> ReceiveWebhookNotification()
{
var request = HttpContext.Request;
var result = await _tammaraNotificationService.ProcessWebhook(request);
return Json(result);
}
3. Test:
POST: https://localhost:2600/Notification/ReceiveNotification Header:
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDEzMDYwOTcsImlhdCI6MTYwMTMwNDI5NywiaXNzIjoiVGFtYXJhIn0.JuoMMVuStl5RLKxfNDRH7nxjFaQBp4YQr-FH9DDR9zk
Body:
{
"order_id": "16280ad8-cde0-4d27-b06d-e6658fe53382",
"order_reference_id": "50548981",
"order_status": "approved",
"data": []
}
API Support:
- GetPaymentTypes --- /checkout/payment-types
- CreateCheckout --- /checkout
- AuthoriseOrder --- /orders/{orderId}/authorise
- CancelOrder --- /orders/{orderId}/cancel
- Capture --- /payments/capture
- Refund --- /payments/refund
- GetOrderDetails --- /orders/{orderId}
- UpdateOrderReferenceId --- /orders/{orderId}/reference-id
- RegisterWebhook --- /webhooks
- RetrieveWebhook --- /webhooks/{webhookId}
- RemoveWebhook --- /webhooks/{webhookId}
- UpdateWebhook --- /webhooks/{webhookId}
- GetOrderDetailsByReference --- /merchants/orders/reference-id/{orderReferenceId}
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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- JWT (>= 7.2.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.8)
- Microsoft.Extensions.Logging.Abstractions (>= 3.1.8)
- Newtonsoft.Json (>= 12.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
This is the first version