A performant SDK for integrating AlatPay payment services into your Flutter applications.
- Seamless payment initialization and verification for bank transfers, USSD and bank details
- UI customization with AlatPayTheme and branding image
All via a simple, unified function
| Bank Transfer | USSD |
|---|---|
![]() |
![]() |
| Bank Details | OTP |
|---|---|
![]() |
![]() |
Above: The included example app.
To initiate a payment , call the AlatPaySdk.startPayment method, and specify the required
props:
AlatPaySdk.startPayment(
context,
request: PaymentRequest(
businessId: "****************",
amount: 100,
currency: "NGN",
customer: Customer(
email: "jane.doe@email.com",
phone: "09038818841",
firstName: "Jane",
lastName: "Doe",
),
),
secretKey: "****************",
onPaymentComplete: (result) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: Colors.green,
content: Text("Successful payment ${result?.message}"),
),
);
},
onPaymentError: (panic) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: Colors.red,
content: Text(panic.toString()),
),
);
},
);It also adds an AlatPayTheme class, which allows you to customize the look and feel of the payment
screens.
AlatPayTheme (
primaryColor: Colors.blue,
secondaryColor: Colors.blueAccent,
)You have optional branding parameter to replace the AlatPay logo with your own image.
branding: "assets/images/branding.png",AlatPaySdk.startPayment includes the following callbacks:
onPaymentComplete: the payment was completed successfully, the call back returns aPaymentResultobjectonPaymentError: the payment failed, the call back returns aStringerror message, this callback only covers errors during the payment process, network errors, invalid parameters, etc
Errors such as invalid otp, invalid bank details, insufficient funds, etc are handled within the payment flow itself and do not trigger this callback.
Grab it from pub.dev.



