hover_ussd 1.0.0
hover_ussd: ^1.0.0 copied to clipboard

A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response.

hover_ussd #

build Pub Star on GitHub Flutter Website License: MIT

© 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 #

 <meta-data
        android:name="com.hover.ApiKey"  
        android:value="<YOUR_API_TOKEN>"/>

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");
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Features #

  • [x] start a transaction
  • [x] listen for result
  • [x] customization
  • [ ] translation

Important #

  • Production ready
  • This is a unofficial plugin

Maintainers #

14
likes
100
pub points
66%
popularity

Publisher

lucdotdev.me

A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on hover_ussd