this repo implements the Daraja mpesa api using node.js
git clone https://github.com/paullaster/node_mpesa_api
-
Node.js version >= 14 https://node.js.org/en/ check version with this command
node -v
-
NPM version >= 6 It is shipped with Node.js. When you install Node.js it will be installed. check version with this command
npm -v
After successfully cloning this app and setting the environment, You'll do the following steps;
use npm install --save
command to install dependencies
Go to config
directory in the app root directory, then create a new file, dev_config.js
.
Inside the dev_config.js
file, you'll need to create and an object with the following properties:
and insert your values.
module.exports = {
port: ,
consumerKey: ,
secretKey: ,
passKey: ,
shortCode: ,
databaseuri:
}
NOTE:
the properties names should exact the same as in the `config.prod.js` file to avoid errors.
npm run start-dev
npm start