- Clone this project
- Run
npm install - Create a
.envfile by copying.env.example. We shall be adding thePrimary Key,User IDandUser Secretfor each product that we are subscribed to. In this case,CollectionsandDisbursements.
- Download and install ngrok.
- Extract it and run
./ngrok http 3000in the same directory. - Leave the terminal tab open as we shall use the NGROK URL generated for the next step.
- Open a new tab in the terminal
- We are going to generate the
User IDandUser Secretfor each subscribed product on the MoMo sandbox using the ngrok url from the previous terminal and the primary key for each product. - Run the command similar to this but specific to your instance.
npx momo-sandbox --host blahblah.ngrok.com --primary-key blah-blah-uu-id- Copy the
Primary Key,User IDandUser Secretfor each product in the.envfile created earlier. - Run
npm run startto start the application.
GET /-> Point of sale web pageGET /pay-> initiates a paymentANY /callback-> receives callback from MTN