MPESA STK-push integration step-by-step guide to integrating lipa na mpesa online in php
In this guide, you are going to learn how to develop Mpesa integration to any custom website using PHP. Mpesa is one of the most popular mobile money transfer services in the world.
The innovative product is offered by Safaricom – Kenya’s leading telecommunication company with the strongest and widest network coverage.
With Mpesa, anyone can send money to you in Kenya using their Safaricom sim card and a mobile phone that supports a Sim Tool Kit(STK).
Safaricom has a ‘Lipa na Mpesa’ service specifically tailored for businesses that want to collect payments through the Mpesa payment gateway for Till and Paybill numbers(short codes).
Lipa na Mpesa offers a lot of convenience to customers and businesses. Text notifications are sent to merchants’ nominated mobile numbers when customers make payments to the business’s short code that is issued for free by Safaricom.
Safaricom Developers Account
Now that we have a new Laravel application, the next step is to make sure that we have an account with Safaricom Developers Account. To create an account visit Daraja Safaricom website. If you have an account with Safaricom Daraja you can log in else sign up.
The next step is to create a new sandbox app by clicking on the Add a New App button and give it a name. Ensure you select both Lipa na Mpesa Sandbox and Mpesa Sandbox and hit Create App button. You will get the following success message. Awesome! Now that we have our app created successfully. Click on your newly created app.
Take note of Consumer Key and Consumer Secret, the two should always be kept as a secret.NB: Never Share Your Consumer Key or Consumer Secret with anyone.Learn more about creating M-pesa Sandbox AppGenerating M-pesa Access TokenSafaricom M-pesa API uses OAuth 2.0 Access token, to invoke M-pesa API we need to generate OAuth 2.0 Access Token and Use Bearer as the keyword.