Giter VIP home page Giter VIP logo

mpesa-node-api's Introduction

Build Status Maintainability Dependency Status contributions welcome Known Vulnerabilities Licence

Mpesa-Node-API(mpesalib)

mpesalib is a Node.js library for Safaricom Daraja API Made for OOP developers with love. You don't need to know the architecture of the Daraja API, just import the functions and pass correct arguments to the function and implement a method that returns a response from function.instance.

Requirements

  1. Node v10+ recommended.
  2. npm v6
  3. ES7/ES6 foundation

You need the following for the .env file all are optional as you can pass them directly as arguments:

  1. Consumer Key and Consume Secret
  2. Test Credentials
  3. API prefix which is the environment
  4. Certificate Path
  5. Short Code, Phone Number and anything that can be passed to the configuration file

Installation

Download the source code and install locally using npm Use the node package manager to install mpesalib

npm install mpesalib

Usage

'use strict';
var Mpesa = require('mpesalib');
//create a new instance
var MpesaApp = new Mpesa();

await MpesaApp.MpesaC2Bs(901292, 254798283876, 1000, 'ref-id');

Importing Specific functions

'use strict';
//imports the b2b mpesa api
var Mpesa = require('mpesalib').MpesaB2B;

Not Done

  • Tests
  • Detailed Documentation
  • Data validation
  • Code Refactoring

Contributing

  1. Create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -m 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request :D

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

I did not write tests so if you wish you can include tests for existing functions. Please make sure to update tests as appropriate.

mpesa-node-api's People

Contributors

matrixjnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kemboi590

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.