A library for Paystack payment gateway for the .Net Core community.
This Library is for .Net Core users
Install this library from NuGet
- For every Controller, should attribute with [System.Obsolete]) at the top.
- Make sure your SecreteKey is store in appsetting.json file
- EXAMPLE: "PaystackService": {"SecretKey": "YOUR_SECRETKEY_HERE"}
using Paystack.NetCore.SDK.Transactions;
var transactionIni = new PaystackTransaction(configuration.GetSection("PaystackService").GetSection("SecretKey").Value);
var response = await transactionIni.InitializeTransaction("customer@test.com", 1000000);
if (response.Status)
{
Response.Headers.Add("Access-Control-Allow-Origin", "*");
Response.Headers.Add("Access-Control-Allow-Origin", "*");
Response.Redirect(response.SubData.AuthorizationUrl);
}
else
{
//Error handling
}