Tamara.SDK 1.0.0

There is a newer version of this package available.
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
#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

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:

  1. Reference your project to Tamara.Net.ClientSDK.dll
  2. 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:

  1. GetPaymentTypes --- /checkout/payment-types
  2. CreateCheckout --- /checkout
  3. AuthoriseOrder --- /orders/{orderId}/authorise
  4. CancelOrder --- /orders/{orderId}/cancel
  5. Capture --- /payments/capture
  6. Refund --- /payments/refund
  7. GetOrderDetails --- /orders/{orderId}
  8. UpdateOrderReferenceId --- /orders/{orderId}/reference-id
  9. RegisterWebhook --- /webhooks
  10. RetrieveWebhook --- /webhooks/{webhookId}
  11. RemoveWebhook --- /webhooks/{webhookId}
  12. UpdateWebhook --- /webhooks/{webhookId}
  13. GetOrderDetailsByReference --- /merchants/orders/reference-id/{orderReferenceId}
Product 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 2,341 11/21/2022
1.0.1 4,156 6/25/2021
1.0.0 2,268 12/2/2020

This is the first version