Last updated:
0 purchases
hover ussd
hover_ussd #
© image by Francis Mwakitumbula
A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response.
android only
Getting Started #
Adding The hover api key refert to documentation at docs.usehover.com
<meta-data
android:name="com.hover.ApiKey"
android:value="<YOUR_API_TOKEN>"/>
copied to clipboard
Usage #
Example
import 'package:flutter/material.dart';
import 'package:hover_ussd/hover_ussd.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
HoverUssd.initialize();
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final HoverUssd _hoverUssd = HoverUssd();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Row(
children: [
FlatButton(
onPressed: () {
_hoverUssd.sendUssd(
actionId: "c6e45e62", extras: {"price": "4000"});
},
child: Text("Start Trasaction"),
),
StreamBuilder(
stream: _hoverUssd.getUssdTransactionState,
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.data == TransactionState.succesfull) {
return Text("succesfull");
} else if (snapshot.data ==
TransactionState.actionDowaloadFailed) {
return Text("action download failed");
} else if (snapshot.data == TransactionState.failed) {
return Text("failed");
}
return Text("no transaction");
},
),
],
),
),
),
);
}
}
copied to clipboard
Features #
✅ start a transaction
✅ listen for result
✅ customization
❌ translation
Important #
Production ready
This is a unofficial plugin
Maintainers #
lucdotdev
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.