A .Net API wrapper for Paystack
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vs
Paystack.Net.Contstants
Paystack.Net.Interfaces
Paystack.Net.Models
Paystack.Net.SDK
packages
.gitignore
Paystack.Net.SDK.sln
README.md

README.md

Paystack.Net.SDK

Paystack.Net.SDK is a library for using the Paystack API from .Net.

Prerequisites

This Library require .Net framework 4.6 or higher

Installing

Install this library from Nuget

Sample web Application

Check out the sample web Application

Usage

Transactions

First, Instantiate PaystackTransactionAPI: Add required using

using Paystack.Net.SDK.Transactions;

Transaction Initialization
var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.InitializeTransaction("customer@gmail.com", 500000);
if(response.status){
    Response.AddHeader("Access-Control-Allow-Origin", "*");
    Response.AppendHeader("Access-Control-Allow-Origin", "*");
	Response.Redirect(response.data.authorization_url);
}else{
//Handle Error
}
Transaction Verification
var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.VerifyTransaction("cipyd2ikxw");

Transaction Listings

var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.ListTransactions();

Fetch Transaction

var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.FetchTransaction(9149218);

Charge Authorization

var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.ChargeAuthorization("AUTH_lqnf8xjy5j", "mark2kk@gmail.com", 5000);

View Transaction Timeline

var paystackTransactionAPI = new PaystackTransaction(YOUR_SECRET_KEY_HERE);
var response = await paystackTransactionAPI.TransactionTimeline("cipyd2ikxw");

Customers

Requires using Paystack.Net.SDK.Customers namespace and an instance of PaystackCustomers

Create Customer

 var paystackCustomerAPI = new PaystackCustomers(YOUR_SECRET_KEY_HERE);
 var response = await paystackCustomerAPI.CreateCustomer("person@live.com", "John", "Doe", "08098786543");

List Customers

 var paystackCustomerAPI = new PaystackCustomers(YOUR_SECRET_KEY_HERE);
 var response = await paystackCustomerAPI.ListCustomers();

Authors

License

This project is licensed under the MIT License

Still on the roadmap

  • Invoices
  • etc