zakah 0.0.4

  • README.md
  • Example
  • Installing
  • Versions
  • 40

Zakah #

CircleCI

Zakah is a client library for safaricom's Mpesa API.
It's name is derived from Kenyan hip hop artiste, Zakah.
It allows you to integrate with safaricom mpesa API.

It's currently work in progress, API will remain unstable for sometime.

MPesa is a mobile phone-based money transfer, financing and microfinancing service, operated by Safaricom, the largest mobile network operator in Kenya. It has since expanded to other countries.
MPesa allows users to deposit, withdraw, transfer money and pay for goods and services easily with a mobile device. - https://en.wikipedia.org/wiki/M-Pesa

Installation #

add the following to your pubspec.yaml file;

dependencies:
  zakah: <1.0.0

then run;

pub get

or with flutter;

flutter packages get

now, in your Dart code, you can use:

import 'package:zakah/zakah.dart';

this lib is also available at Pub package repository

Usage #

import 'dart:async';
import 'package:zakah/zakah.dart' as zakah;

Future<void> main() async {
  var m = new zakah.Mpesa('ConsumerKey', 'ConsumerSecret');
  Map b2cResult = await m.b2c(
      "apitest390",
      "SecurityCredential",
      zakah.CommandID["BusinessPayment"],
      300,
      "601390",
      "254708374149",
      "some remaks",
      Uri.parse("https://www.google.com"),
      Uri.parse("https://www.google.com"),
      occasion: "some occasion");

  print("final b2cResult::");
  print(b2cResult);
}

Features #

  • todo

Development setup #

  • fork this repo.
  • you need to have dart version2 installed.
  • open an issue on this repo. In your issue, outline what it is you want to add and why.
  • make the changes you want on your fork.
  • your changes should have backward compatibility in mind unless it is impossible to do so.
  • add tests
  • format your code using dartfmt:
dartfmt --overwrite --profile --follow-links .
  • run tests and make sure everything is passing:
pub run test .
  • open a pull request on this repo.
    NB: I make no commitment of accepting your pull requests.

example/example.dart

import 'dart:async';
import 'package:zakah/zakah.dart' as zakah;

Future<void> main() async {
  var m =
      new zakah.Mpesa('KNJH6N40cjL8saPjDmJxvcx1AyVywVzw', 'SQhQ4EeOXMTe96D5');
  Map b2cResult = await m.b2c(
      "apitest390",
      "c6x4tK+uZzTyRtn7vFG//ctViOSfiYCCYGQ4j+xvQfeOC/zbv9Iszr/c6niGtqHRyuLAgGKV0G6zzQtc0QcEIzH9c6fOG/JA03OS5RRFccHI3sCQ0ucVGuYD4FbxM1EMAMgj09C21WGouXiFPenF0wwxFPZLRs9JBFOXfLNPbaA8+03TrYnID1mFR+nDfDT5xOvuk1JWnkmTk9NJDOtT+Fn2dP1DBrMbIW0tmROkMsKm3zCV4QJmKbnr/Ds+/HyXyGmr3UOUU3t9jq973uJ/y6/8TukQmA4dkjXGy7agzAO4pPIYWScpiom3K/JY//Z5EdSUn1f4SYrwHiH8cTmjCw==",
      zakah.CommandID["BusinessPayment"],
      300,
      "601390",
      "254708374149",
      "some remaks",
      Uri.parse("https://www.google.com"),
      Uri.parse("https://www.google.com"),
      occasion: "some occasion");

  print("final b2cResult::");
  print(b2cResult);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  zakah: ^0.0.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:zakah/zakah.dart';
  
Version Uploaded Documentation Archive
0.0.4 Aug 8, 2018 Go to the documentation of zakah 0.0.4 Download zakah 0.0.4 archive
0.0.3 May 29, 2018 Go to the documentation of zakah 0.0.3 Download zakah 0.0.3 archive
0.0.2 May 29, 2018 Go to the documentation of zakah 0.0.2 Download zakah 0.0.2 archive
0.0.1 May 29, 2018 Go to the documentation of zakah 0.0.1 Download zakah 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
52
Overall:
Weighted score of the above. [more]
40
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, other

Primary library: package:zakah/zakah.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

17 out of 17 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-18 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
Dev dependencies
test >=1.0.0