Accompanying blog can be found here
Sending user a prompt to pay for an order using the stk push API and also confirming the payment using the checkout request ID
To ensure you gain the most out of this session please make sure you have the following installed:
To run the webscrapper
-
Clone the repo
git clone https://github.com/wamaithanyamu/Lipa-na-Mpesa-STK-Push-.git
-
Install NPM packages
npm install
-
Create a .env file and add the following values. Retrieve them from the Safaricom daraja portal here
SAFARICOM_CONSUMER_SECRET= SAFARICOM_CONSUMER_KEY= PASS_KEY= BUSINESS_SHORT_CODE= PORT=3000 # port your server will run on
-
Run the server
node server.js
-
Use postman to make requests.
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Tweet me at- @wamaithanyamu or shoot me an email at [email protected]
Project Link: https://github.com/wamaithanyamu/Lipa-na-Mpesa-STK-Push-