ilebora_stk 0.0.1 copy "ilebora_stk: ^0.0.1" to clipboard
ilebora_stk: ^0.0.1 copied to clipboard

BoraSTK is a Flutter package for simplified integration of Safaricom's Lipa Na M-Pesa Online API, enabling seamless STK push payments in mobile applications.

example/main.dart

import 'package:ilebora_stk/ilebora_stk.dart';

void main(){

	final BoraSTK boraSTK = BoraSTK(
		userID: 'developer_user_id', //Provided ID
		apiKey: 'developer_api_key', //Provided ID
		phone: 'customer_phone_number', //Safaricom
		amount: '1', //Amount to pay
		orderID: '12345', //Order ID description
		displayName: 'BORA', //The name to display on the STK Push
		onSuccess: (BoraPushTransaction response){ //Do something with the response
			print('Payment Successful!');
			print(response);
		},
		onFailure: (String err) { //Do something on error
			print('Payment Failed!');
			print('Error: $err');
		},
	);

	// Show STK Screen
	// boraSTK.showSTKScreen(
	// 	context,
	// 	backgroundColor: Colors.white,
	// 	buttonColor: Colors.green,
	// 	textColor: Colors.white,
	// );

	// Show STK Dialog
	// boraSTK.showSTKDialog(
	// 	context,
	// 	backgroundColor: Colors.white,
	// 	buttonColor: Colors.green,
	// 	textColor: Colors.white,
	// );

}
1
likes
130
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

BoraSTK is a Flutter package for simplified integration of Safaricom's Lipa Na M-Pesa Online API, enabling seamless STK push payments in mobile applications.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

equatable, flutter, flutter_bloc, flutter_client_sse, formz, http, ilebora_push, package_info, universal_html

More

Packages that depend on ilebora_stk