mpesa 2.0.2 mpesa: ^2.0.2 copied to clipboard
This is a dart wrapper around mpesa daraja api. Written in pure dart which means it's framework agnostic(ios,android,web,plain dart,fuschia) and works out of the box.
import 'package:mpesa/mpesa.dart';
void main() {
final mpesa = Mpesa(
clientKey: "YOUR_CONSUMER_KEY_HERE",
clientSecret: "YOUR_CONSUMER_SECRET_HERE",
passKey: "YOUR_LNM_PASS_KEY_HERE",
environment: "sandbox",
);
mpesa
.lipaNaMpesa(
phoneNumber: "",
amount: 1,
businessShortCode: "",
callbackUrl: "",
)
.then((result) {})
.catchError((error) {});
}