Coder Social home page Coder Social logo

uganda_mobile_money's Introduction

MTN AIRTEL

Add Mobile Money payments to your flutter apps using the FlutterWave api gateway.

Features

  • Recieve Payments through Mobile Money in Uganda
  • Supports MTN Momo Transactions
  • Supports Airtel Money Transactions
  • Verify Charges your have made before adding value

Getting started

Get your api keys, head over to https://dashboard.flutterwave.com/settings/apis

You might also want to read about flutterwaves documentation. For this head to https://developer.flutterwave.com/reference

Usage

Create an instance of the UgandaMobileMoney class.

const secretKey = "FLWSECK-XXXXX-X"; // flutterwave secret key
UgandaMobileMoney _mobileMoney = UgandaMobileMoney(secretKey); 

Initiate Payments

void chargeClient() async {
    MomoPayResponse response = await _mobileMoney.chargeClient(
        MomoPayRequest(
            txRef: "MC-01928403", // should be unique for each transaction
            amount: "1500", // amount in UGX you want to charge
            email: "[email protected]", // email of the person you want to charge
            phoneNumber: "256123456723", // clients phone number
            fullname: "Ojangole Joran", // full name of client
            redirectUrl: "https://yoursite.com", // redirect url after payment
            voucher: "128373", // useful for vodafone. you can ignore this
            network: UgandaNetwork.mtn // network, can be either mtn or airtel
            ),
        );

    print(response.message);
  }

To Verify transactions

   void verifyTransaction() {
    _mobileMoney.verifyTransaction(taxRef).then((value) {
      if (value == TransactionStatus.failed) {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text("Failed")));
      } else if (value == TransactionStatus.pending) {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text("Pending")));
      } else if (value == TransactionStatus.success) {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text("Success")));
      } else if (value == TransactionStatus.unknown) {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text("Unknown")));
      } else {
        ScaffoldMessenger.of(context)
            .showSnackBar(SnackBar(content: Text("Unknown")));
      }
    });
  }

Additional information

Please contact me if your have any feature requests or file issues via the respository.

You can also buy me a rolex : https://dashboard.flutterwave.com/donate/7nacgysd7ilf

uganda_mobile_money's People

Contributors

jordanopos avatar

Stargazers

Tony avatar  avatar Tizi Bienvenus avatar Ronnie Atuhaire avatar  avatar Musweu Munyima avatar Akbr Kanyesigye avatar  avatar Raj Salunkhe avatar

Watchers

Akbr Kanyesigye avatar  avatar

uganda_mobile_money's Issues

error

I am also getting that every error! what is the problem?

type 'Null' is not a subtype of type 'Map<String, dynamic>'

example

help me with a working sample because i have tried but i get.
I/flutter ( 3447): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 3447): │ #0 UgandaMobileMoney.chargeClient (package:uganda_mobile_money/client.dart:36:15)
I/flutter ( 3447): │ #1
I/flutter ( 3447): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter ( 3447): │ ⛔ type 'Null' is not a subtype of type 'Map<String, dynamic>'
I/flutter ( 3447): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter ( 3447): Something Went wrong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.