Check RaveApi.Test project program file for full Implementation.
install from Nuget.
Install-Package RaveApi
https://www.nuget.org/packages/RaveApi/
Rave website.
https://developer.flutterwave.com/
// use your secret key from Rave Dashboard
static string Secretkey = "Your Rave Secret key";
// use your Public key from Rave Dashboard
static string PublicKey = "Your Rave Public Key";
static string chargeEndpoint = "charge";
static string validationEndpoint = "validatecharge";
Payment payment = new Payment();
var key = payment.GetEncryptionKey(Secretkey);
var json = JsonConvert.SerializeObject(GetData());
var encryptedData = payment.EncryptData(key, json);
PayLoad postData = GetPayLoad(encryptedData);
var jsondata = JsonConvert.SerializeObject(postData);
ChargeResponse chargeReponse = await payment.SuggestCardType(chargeEndpoint, jsondata);
#Payload
private static PayLoad GetPayLoad(string encryptedData)
{
return new PayLoad
{
PBFPubKey = PublicKey,
client = encryptedData,
alg = "3DES-24"
};
}
private static ChargeModel GetData(string suggested_auth = "", string pin = "")
{
return new ChargeModel
{
PBFPubKey = PublicKey,
cardno = "5438898014560229",
currency = "NGN",
country = "NG",
cvv = "789",
amount = "3002",
expiryyear = "19",
expirymonth = "09",
suggested_auth = suggested_auth,
pin = pin,
email = "info@storefella.com",
phonenumber = "08012345678",
firstname = "Ekene",
lastname = "Duru",
IP = GetIPAddress(),
txRef = GenerateTransactionCode(),
redirect_url= "https://yourreturnurl/receivepayment",
};
}
-
Notifications
You must be signed in to change notification settings - Fork 0
ekeneduru/RaveApi
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
This will help you to use Flutterwave Rave payment api for C#. One of the payment gateway in Nigeria.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published