mpesalib
v0.0.2
Published
Daraja API nodejs library
Downloads
2
Readme
Mpesa-Node-API(mpesalib)
mpesalib is a Node.js library for Safaricom Daraja API Made for OOP developers with love.
Requirements
- Node v10+ recommended.
- npm v6
- ES7/ES6 foundation
You need the following for the .env file all are optional as you can pass them directly as arguments:
- Consumer Key and Consume Secret
- Test Credentials
- API prefix which is the environment
- Certificate Path
- 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
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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.