unofficial_mazzuma_plugin

This is an unofficial implementation of Mazzuma's payment Api in flutter

Getting Started

Installation

Add this to your pubspec.yaml (or create it):

dependencies:
  unofficial_mazzuma_plugin: x.x.x  #latest version

Then run the flutter tooling:

flutter packages get

Or upgrade the packages with:

flutter packages upgrade

import library

import 'package:unofficial_mazzuma_plugin/unofficial_mazzuma_plugin.dart';

Example


UnofficialMazzumaPlugin mazzumaPlugin = new UnofficialMazzumaPlugin();

 void makePayment(String userNetwork, String userNumber, double paymentAmount) {
    String paymentOption;
    String myNumber = "YOUR-MOBILE-NUMBER-HERE"; 
    String myApiKey = "YOUR-API-KEY-HERE";
    
/** This denotes the direction of cash flow. For example, rmta can be understood as an acronym of the phrase
‘receive mtn to airtel’, which means you would be receiving money to your Airtel account (the recipient number) 
from an MTN number(the sender). This format would hold for all transaction requests sent to the API.
 Do not forget to append the r at beginning. **/
 
    if (userNetwork == "AIRTEL") {
      paymentOption = "ratm"; 
    } else if (userNetwork == "MTN") {
      paymentOption = "rmtm";
    } else if (userNetwork == "TIGO") {
      paymentOption = "rttm";
    } else {
      paymentOption = "unknown";
    }
    print("network is: $userNetwork");
    print("payemnt option is: $paymentOption");
    print("payment amount is: $paymentAmount");
    print("my number is: $myNumber");
    print("user Number is: $userNumber");
    print("myApiKey is: $myApiKey");

    var response = mazzumaPlugin.processPayment(paymentAmount, userNetwork,
        myNumber, userNumber, paymentOption, myApiKey);
    response.then(print);
  }

Libraries

unofficial_mazzuma_plugin

Dart

dart:ui
Built-in types and core primitives for a Flutter application. [...]

Core

dart:async
Support for asynchronous programming, with classes such as Future and Stream. [...]
dart:collection
Classes and utilities that supplement the collection support in dart:core. [...]
dart:convert
Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
dart:core
Built-in types, collections, and other core functionality for every Dart program. [...]
dart:developer
Interact with developer tools such as the debugger and inspector. [...]
dart:math
Mathematical constants and functions, plus a random number generator. [...]
dart:typed_data
Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]

VM

dart:io
File, socket, HTTP, and other I/O support for non-web applications. [...]
dart:isolate
Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]