Skip to content

Mpesa STK Push utility for Daraja API integrations

Notifications You must be signed in to change notification settings

wathika-eng/mpesa_example_python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

  1. Clone the repository
git clone https://github.com/wathika-eng/mpesa_example_python --depth 1 && cd mpesa_example_python
  1. Activate virtualenv and nstall the dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Copy and update the environment variables
cp .env.example .env

On line 254 in mpesa.py after main() function, replace phone number with your phone number.

    try:
        mpesa_client = MPesaClient()

        # Example transaction, change as needed
        phone_number = "254746554245"
  1. Run the application
python mpesa.py

Sample output

Response: image

Logs: sampleLogs

About

Mpesa STK Push utility for Daraja API integrations

Topics

Resources

Stars

Watchers

Forks

Languages

  • Python 100.0%