PayStackDotNetSDK API is a collection of all PayStack endpoints that C# developers can take advantage of to build financial solutions in Nigeria. Visit Paystack for Setup.
This Library require .Net framework 4.6 or higher
Install this library from Nuget
- Olorunfemi Ajibulu - Booksrite
Install this library from Github
This project[alpha stage] showcases some uses of PayStackDotNetSDK methods. Github
This project is licensed under the MIT License
- More precise intellisense
- More Documentation in this README file
Add namespaces: using PayStackDotNetSDK; using PayStackDotNetSDK.Helpers;
- Read Documentation Here - PAYSTACK API Documentation
add namespaces: using PayStackDotNetSDK.Methods.Transactions; using PayStackDotNetSDK.Models.Transactions;
/// <summary>
/// Implements simple InitializeTransaction with basic parameters
/// </summary>
protected async void InitializeTransaction()
{
var connectionInstance = new PaystackTransaction(Credential.Key);
var response = await connectionInstance.InitializeTransaction("[email protected]", 1000000);
if (response.status)
{
Response.AddHeader("Access-Control-Allow-Origin", "*");
Response.AppendHeader("Access-Control-Allow-Origin", "*");
Response.Redirect(response.data.authorization_url); //Redirects your browser to the secure URL
}
else //not successful
{
//Do something else with the info.
}
}
/// <summary>
/// Implements simple InitializeTransaction with full parameters
/// If callback url is given, the url will be called upon completion. For example http://localhost:60441/Default.aspx?trxref=4dsnq70qtd&reference=4dsnq70qtd
/// </summary>
protected async void InitializeTransaction()
{
var connectionInstance = new PaystackTransaction(Credential.Key);
var response = await connectionInstance.InitializeTransaction(new TransactionRequestModel() { firstName="firstname", lastName="lastname", amount=1000000, currency = PayStackDotNetSDK.Helpers.Constants.Currency.Naira, email="[email protected]", metadata = new PaystackMetadata() { referrer="[email protected]" }, transaction_charge=4000 });
if (response.status)
{
Response.AddHeader("Access-Control-Allow-Origin", "*");
Response.AppendHeader("Access-Control-Allow-Origin", "*");
Response.Redirect(response.data.authorization_url); //Redirects your browser to the secure URL
}
else //not successful
{
//Do something else with the info.
}
}
add namespaces: using PayStackDotNetSDK.Methods.Customers; using PayStackDotNetSDK.Models.Customers;
add namespaces: using PayStackDotNetSDK.Methods.Subaccounts; using PayStackDotNetSDK.Models.SubAccounts;
add namespaces: using PayStackDotNetSDK.Methods.Plans; using PayStackDotNetSDK.Models.Plans;
add namespaces: using PayStackDotNetSDK.Methods.Subscriptions; using PayStackDotNetSDK.Models.Subscriptions;
add namespaces: using PayStackDotNetSDK.Methods.Pages; using PayStackDotNetSDK.Models.Pages;
add namespaces: using PayStackDotNetSDK.Methods.Invoices; using PayStackDotNetSDK.Models.Invoices;
add namespaces: using PayStackDotNetSDK.Methods.Settlements; using PayStackDotNetSDK.Models.Settlements;
add namespaces: using PayStackDotNetSDK.Methods.TransferRecipients; using PayStackDotNetSDK.Models.TransferRecipients;
add namespaces: using PayStackDotNetSDK.Methods.Transfers; using PayStackDotNetSDK.Models.Transfers;
add namespaces: using PayStackDotNetSDK.Methods.TransfersControls; using PayStackDotNetSDK.Models.TransfersControls;
add namespaces: using PayStackDotNetSDK.Methods.Charges; using PayStackDotNetSDK.Models.Charges;
add namespaces: using PayStackDotNetSDK.Methods.BulkCharges; using PayStackDotNetSDK.Models.BulkCharges;
add namespaces: using PayStackDotNetSDK.Methods.Refunds; using PayStackDotNetSDK.Models.Refunds;
add namespaces: using PayStackDotNetSDK.Methods.ControlPanels; using PayStackDotNetSDK.Models.ControlPanels;
add namespaces: using PayStackDotNetSDK.Methods.Verifications; using PayStackDotNetSDK.Models.Verifications;
add namespaces: using PayStackDotNetSDK.Methods.Banks; using PayStackDotNetSDK.Models.Banks;
///