All Projects → newtonmunene99 → mpesa-dart

newtonmunene99 / mpesa-dart

Licence: MIT License
A dart wrapper around mpesa daraja api

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to mpesa-dart

mpesa-rest-api
mpesa rest api converts the mpesa api to a RESTful API that is easy for developers to use instead of the current SOAP web service provided by mpesa.
Stars: ✭ 24 (+26.32%)
Mutual labels:  mpesa, mpesa-api
python-daraja
Python Wrapper for interacting with the MPESA Daraja API. More Features to be implemented
Stars: ✭ 20 (+5.26%)
Mutual labels:  mpesa, mpesa-api
php-pesa
Open payment integration toolkit for PHP
Stars: ✭ 26 (+36.84%)
Mutual labels:  mpesa, mpesa-api
sapamapay
New Safaricom MPESA (Daraja) API
Stars: ✭ 31 (+63.16%)
Mutual labels:  mpesa, mpesa-api
safaricom-daraja-nodejs
Standalone M-Pesa payments service using the new Daraja Payment API by Safaricom.
Stars: ✭ 31 (+63.16%)
Mutual labels:  mpesa, mpesa-api
JustJava-Android
JustJava is a mock food ordering and delivery application for a coffee shop.
Stars: ✭ 59 (+210.53%)
Mutual labels:  mpesa
mpesa-rust
An abstraction/wrapper on top of Safaricom's M-PESA daraja api in Rust
Stars: ✭ 17 (-10.53%)
Mutual labels:  mpesa
mobile-money
Mobile Money Payments API in Kenya (MPESA, EQUITY/EQUITEL,T-CASH). Supports B2B, B2C and C2B
Stars: ✭ 17 (-10.53%)
Mutual labels:  mpesa-api
ex pesa
Payment Library For Most Public Payment API's in Kenya and hopefully Africa. Let us get this moneybag
Stars: ✭ 19 (+0%)
Mutual labels:  mpesa
pesa-js
Pesa SDK
Stars: ✭ 19 (+0%)
Mutual labels:  mpesa
loopy
Loopy is an unofficial cli client for CBA Loop for the lazy bones
Stars: ✭ 23 (+21.05%)
Mutual labels:  mpesa
Chowder
Chowder for Android M-Pesa payments.
Stars: ✭ 31 (+63.16%)
Mutual labels:  mpesa-api
tz-mpesa-ussd-push
Vodacom Tanzania USSD Push API Client
Stars: ✭ 18 (-5.26%)
Mutual labels:  mpesa

mpesa

A dart wrapper around mpesa daraja api.

Ready Methods/APIs

  • LIPA NA MPESA
  • C2BSIMULATE
  • B2B
  • C2B
  • B2C
  • TRANSACTION STATUS
  • ACCOUNT BALANCE
  • REVERSAL

Requisites

You Will need a few things from Safaricom before development.

  1. Consumer Key
  2. Consumer Secret
  3. Test Credentials for Development/Sanbox environment
  • Login or Register as a Safaricom developer here if you haven't.
  • Add a new App here
  • You will be issued with a Consumer Key and Consumer Secret. You will use these to initiate an Mpesa Instance.
  • Obtain Test Credentials here.
    • The Test Credentials Obtained Are only valid in Sandbox/Development environment. Take note of them.
    • To run in Production Environment you will need real Credentials.
      • To go Live and be issued with real credentials,please refer to this guide

Getting Started

Add dependency in pubspec.yaml

dependencies:
  mpesa: [ADD_LATEST_VERSION_HERE]

Import in your Flutter app or plain dart app.

import 'package:mpesa/mpesa.dart';

class MYClass {

    Mpesa mpesa = Mpesa(
        clientKey: "YOUR_CONSUMER_KEY_HERE",
        clientSecret: "YOUR_CONSUMER_SECRET_HERE",
        passKey: "YOUR_LNM_PASS_KEY_HERE",
        environment: "sandbox",
    );

}

Environment should be either sandbox or production

Methods and Api Calls

Lipa Na Mpesa Online (LNMO)

Lipa na M-Pesa Online Payment API is used to initiate a M-Pesa transaction on behalf of a customer using STK Push. This is the same technique mySafaricom App uses whenever the app is used to make payments.

import 'package:mpesa/mpesa.dart';

class MYClass {

    myMethod(){
        mpesa
            .lipaNaMpesa(
                phoneNumber: "",
                amount: 1,
                businessShortCode: "",
                callbackUrl: "",
            )
            .then((result) {})
            .catchError((error) {});
    }
}
  1. businessShortCode - The organization shortcode used to receive the transaction.
  2. amount - The amount to be transacted.
  3. phoneNumber - The MSISDN sending the funds.
  4. callbackUrl - The url to where responses from M-Pesa will be sent to.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Recording

Recording

Demo App

Demo App

Contributing

  1. Fork the project then clone the forked project
  2. Create your feature branch: git checkout -b my-new-feature
  3. Make your changes and add name to Contributors list below and in authors in pubspec.yaml
  4. Commit your changes: git commit -m 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request.

Credits

Contributors
Newton Munene

For help getting started with Flutter, view their online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].