flutter_paystack_max

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter paystack max

A Flutter package for making payments via Paystack Payment Gateway (https://paystack.com)










Features #
✔️ All Paystack supported payment methods/channels

Mobile Money
Card
USSD
Bank Transfer
Bank
QR
EFT

✔️ Verifying Transactions
Supported Platforms #

Android and
iOS

Prerequisites #

Paystack secret key
Callback URL

No configuration required for this package works out of the box.
Usage #

Create a transaction request object.

final request = PaystackTransactionRequest(
reference: '...',
secretKey: '....',
email: '...',
amount: 15 * 100,
currency: PaystackCurrency.ngn,
channel: [
PaystackPaymentChannel.mobileMoney,
PaystackPaymentChannel.card,
PaystackPaymentChannel.ussd,
PaystackPaymentChannel.bankTransfer,
PaystackPaymentChannel.bank,
PaystackPaymentChannel.qr,
PaystackPaymentChannel.eft,
],
);
copied to clipboard

Initialize the transaction with the above transaction request.

final initializedTransaction = await PaymentService.initializeTransaction(request);

if (!initializedTransaction.status) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
backgroundColor: Colors.red,
content: Text(initializedTransaction.message),
));

return;
}
copied to clipboard

Open the payment modal to accept payment

final response = await PaymentService.showPaymentModal(
context,
transaction: initializedTransaction,
// Callback URL must match the one specified on your paystack dashboard,
callbackUrl: '...'
).then((_) async {
return await PaymentService.verifyTransaction(
paystackSecretKey: '...',
initializedTransaction.data?.reference ?? request.reference,
);
});

print(response); // Result of the confirmed payment
copied to clipboard
Additional information #
Visit the paystack documentation for more information https://paystack.com/docs/api/transaction
📝 Contributing, 😞 Issues and 🐛 Bug Reports #
This project is open to contributions.
Please feel very free to help improve the payment experience on Flutter.
Experienced an issue or want to report a bug? Please, report it here.

License

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

Customer Reviews

There are no reviews.