0.0.2 • Published 5 years ago

mpesalib v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Build Status Maintainability Dependency Status contributions welcome Licence

Mpesa-Node-API(mpesalib)

mpesalib is a Node.js library for Safaricom Daraja API Made for OOP developers with love.

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 MpesApp.MpesaC2Bs(901292, 254798283876, 1000, 'ref-id');

Importing Specific functions

'use strict';
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.