pay_with_paystack

Last updated:

0 purchases

pay_with_paystack Image
pay_with_paystack Images
Add to Cart

Description:

pay with paystack

Features #
๐ŸŽ‰Mobile Money๐ŸŽ‰
๐ŸŽ‰VISA๐ŸŽ‰
๐ŸŽ‰Bank๐ŸŽ‰
๐ŸŽ‰Bank Transfer๐ŸŽ‰
๐ŸŽ‰USSD๐ŸŽ‰
๐ŸŽ‰QR๐ŸŽ‰
๐ŸŽ‰EFT๐ŸŽ‰
Getting started #
Before you run, do the following in your android/app/build.gradle
Update your compileSDKVersion to latest
android {
compileSdkVersion 32
}
copied to clipboard
Update your minSDKVersion to 19
defaultConfig {
minSdkVersion 19
}
copied to clipboard
Usage #
Simply call the PayWithPayStack class to start making payments with paystack. As simple as that. Please note that for reference its important you use a unique id. I recommend uuid. I have added it as part of the package. Please see example below to see how it is used.
Example
final uniqueTransRef = PayWithPayStack().generateUuidV4()

PayWithPayStack().now(
context: context
secretKey:
"sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
customerEmail: "[email protected]",
reference:uniqueTransRef,
callbackUrl: "setup in your paystack dashboard"
currency: "GHS",
paymentChannel:["mobile_money", "card"],
amount: 2000,
transactionCompleted: () {
print("Transaction Successful");
},
transactionNotCompleted: () {
print("Transaction Not Successful!");
});
copied to clipboard
Definitions #
context
To aid in routing to screens
secretKey
Provided by Paystack
customerEmail
Email address of the user/customer trying to make payment for receipt purpose
reference
Unique ID to recognise this transaction in your paystack dashboard. I've added uuidv4 to help with that. Kindly see the example in the readme. Alternatively you can create your own unique id.
currency
Currency user/customer should be charged in
amount
Amount or value user/customer should be charged.
callbackUrl
URL to redirect to after payment is successful, this helps close the session. This is setup in the Dashboard of paystack and the same URL setup is then provided here by you again. This is very important for successful or failed transactions
paymentChannels [Optional]
Payment Channels are provided to you by Paystack and some may not be available based on your country and preferences set in your paystack dashboard. Example; ["card", "bank", "ussd", "qr", "mobile_money", "bank_transfer", "eft"]
transactionCompleted
Execute a function when transaction is completed or is successful
transactionNotCompleted
Execute a function when transaction is not completed or is successful
metadata [Optional]
Extra data for development purposes. Example:
"metadata": {
"custom_fields": [
{
"name": "Daniel Kabu Asare",
"phone": "+2330267268224"
}
]
}
copied to clipboard
Screenshots #


Additional information #
For more information and bug reports, Contact me on github @popekabu
๐Ÿ“ Contributing, ๐Ÿ˜ž Issues and ๐Ÿ› Bug Reports #
The project is open to public contribution. Please feel very free to contribute. Experienced an issue or want to report a bug? Please, report it here. Remember to be as descriptive as possible.
Support my Work ๐Ÿ™๐Ÿฝ #
Buy me coffee here. Thank you!

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.