Paystack.NET.Client 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Paystack.NET.Client --version 1.0.1
                    
NuGet\Install-Package Paystack.NET.Client -Version 1.0.1
                    
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="Paystack.NET.Client" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Paystack.NET.Client" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Paystack.NET.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Paystack.NET.Client --version 1.0.1
                    
#r "nuget: Paystack.NET.Client, 1.0.1"
                    
#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.
#:package Paystack.NET.Client@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Paystack.NET.Client&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Paystack.NET.Client&version=1.0.1
                    
Install as a Cake Tool

Paystack.NET Client

Paystack.NET Client is a .NET package designed to provide seamless integration with the Paystack API. It is a portable class library that facilitates easy access to various Paystack services, enabling developers to effortlessly manage payments, transactions, and more within their .NET applications.

Whether you're building a payment gateway, managing transactions, or integrating with Paystack's rich feature set, Paystack.NET Client streamlines the process, saving you development time and effort.

Installation

Using the .NET Core command-line interface (CLI) tools:

dotnet add package Paystack.NET.Client

Using the NuGet Command Line Interface (CLI):

nuget install Paystack.NET.Client

Using the Package Manager Console:

Install-Package Paystack.NET.Client

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 "Paystack.NET".
  5. Click on the Paystack.NET package, select the appropriate version in the right-tab and click Install.

Documentation

For a comprehensive list of examples, check out the Examples Project.

Authentication

Paystack authenticates API requests using your account’s secret key, which you can find in the Paystack Dashboard (Settings > API Keys & Webhooks)

Use Configure method in PaystackConfiguration to set the Secret Key and the Base URL if needed.

PaystackConfiguration.Configure("sk_test_...");

Examples

Initialize a Transaction

using Paystack.NET.Configuration;
using Paystack.NET.Services.Transactions;
using Paystack.NET.Models.Transactions.Options;

PaystackConfiguration.Configure("sk_test_...");

var transactionService = new TransactionService();

var initializeOptions = new InitializeTransactionOptions
{
    Reference = "TEST-" + DateTime.Now.ToString("yyyyMMddHHmmss");
    Amount = 5000, // Amount in pesewas
    Email = "customer@example.com"
};

var response = await transactionService.Initialize(initializeOptions);
Console.WriteLine($"Transaction Reference: {response.Data.Reference}");

Verify a Transaction

var reference = "TRANSACTION_REFERENCE_HERE";
var response = await transactionService.Verify(reference);

if (response.Data is { Status: TransactionStatus.Success })
{
    Console.WriteLine("Transaction successful!");
}

Setup a Callback (Webhook)

using Paystack.NET.Services.Callback;


var requestBody = "{ ... }"; // Raw request body from Paystack webhook
var signatureHeader = "X-Paystack-Signature header from request";

var callbackService = new CallbackService();

try
{
    var callback = callbackService.HandleCallback(requestBody, signatureHeader);
    Console.WriteLine($"Event: {callback.Event}");
    Console.WriteLine($"Data: {callback.Data}");
}
catch (UnauthorizedAccessException)
{
    Console.WriteLine("Invalid webhook signature.");
}

Development

Contribution guidelines for this project

.NET 8 is required to build and test Paystack.NET SDK, you can install it from get.dot.net.

For any requests, bug or comments, please open an issue or submit a pull request.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.4 129 2/21/2026
1.0.3 244 8/21/2025
1.0.2 239 8/14/2025
1.0.1 249 8/14/2025
1.0.0 320 2/11/2025