Spare.NET.Sdk 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Spare.NET.Sdk --version 1.3.0                
NuGet\Install-Package Spare.NET.Sdk -Version 1.3.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="Spare.NET.Sdk" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Spare.NET.Sdk --version 1.3.0                
#r "nuget: Spare.NET.Sdk, 1.3.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 Spare.NET.Sdk as a Cake Addin
#addin nuget:?package=Spare.NET.Sdk&version=1.3.0

// Install Spare.NET.Sdk as a Cake Tool
#tool nuget:?package=Spare.NET.Sdk&version=1.3.0                

sdk-csharp

Usage

I- Download nuget package
<PackageReference Include="Spare.NET.Sdk" Version="1.2.2" />
II- To Generate ECC key pair
 class Program
{
    static void Main(string[] args)
    {
        var eccKeyPair = SpCrypto.GenerateKeyPair();
            
        Console.WriteLine($"Private key \n{eccKeyPair.PrivateKey}");
        Console.WriteLine("\n\n");
        Console.WriteLine($"Public key \n{eccKeyPair.PublicKey}");
    }
}
II- To create a domestic payment
1. In the ConfigureServices method of Startup.cs, register the SpPaymentClient..
public void ConfigureServices(IServiceCollection services)
{
    services.AddSpPaymentClient(options =>
    {
        options.ApiKey = "Your API key";
        options.AppId = "Your app id";
        options.BaseUrl = new Uri("https://payment.tryspare.com");
    });
}
2. Inject the service on the desired controller..
public class TestController : Controller
    {
        private readonly ISpPaymentClient _client_;

        // Business ECC private key
        private readonly PrivateKey = "Your ecc private key";

        // Spare ECC public key
        private readonly ServerPublicKey = "Server ecc public key";

        public TestController(ISpPaymentClient client)
        {
            _client = client;
        }
        
        // GET
        public async Task<IActionResult> Index()
        {
            // Initialize payment
             var payment = new SpDomesticPaymentRequest
            {
                Amount = 10m,
                Description = "Payment description"
            };

            // Sign the payment
            var signature = SpEccSignatureManager.Sign(payment, PrivateKey);

            // Create payment
            var createPayment =  await _paymentClient.CreateDomesticPayment(payment,signature);

           // To verify signature of the created payment 
           if(SpEccSignatureManager.Verify(createPayment.PaymentResponse, createPayment.Signature, ServerPublicKey)){
               // signature verified
           }
        }
    }
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  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. 
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.3.2 359 12/3/2022
1.3.1 347 11/24/2022
1.3.0 333 11/24/2022
1.2.4 419 7/27/2022
1.2.3 396 7/27/2022
1.2.2 413 7/23/2022
1.2.1 433 7/23/2022
1.2.0 433 7/23/2022
1.0.1 1,830 11/26/2021
1.0.0 1,846 11/23/2021