- Clone this project
- Run
npm install
- Create a
.env
file by copying.env.example
. We shall be adding thePrimary Key
,User ID
andUser Secret
for each product that we are subscribed to. In this case,Collections
andDisbursements
.
- Download and install ngrok.
- Extract it and run
./ngrok http 3000
in 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 ID
andUser Secret
for 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 ID
andUser Secret
for each product in the.env
file created earlier. - Run
npm run start
to start the application.
GET /
-> Point of sale web pageGET /pay
-> initiates a paymentANY /callback
-> receives callback from MTN