a simple to use mpesa module around the daraja api
Project description
Daraja - Easy to use functions around M-Pesa Daraja API
This module provides functions around the daraja api to simplify the whole integration process.
This is what you need to do:
-
Fill out the
config.json
file with your credentials from Daraja dashboard. -
Install daraja with
pip install daraja
-
Import the
mpesa
module fromdaraja
like so:
from daraja import mpesa
- Instantiate a Mpesa object with only two parameters, the config.json file and your environment(either dev or prod)
...
mpesa = mpesa.Mpesa(config_file="config.json", env="prod")
- Use the Mpesa object to do stuff, like so:
...
response = mpesa.stk(receiver="254791500264, amount=50)
print(response)
I am working on implementing the remaining endpoints and even right now this does not work functionally well and i am working to solve the issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
daraja-0.0.3.tar.gz
(3.5 kB
view hashes)
Built Distribution
daraja-0.0.3-py3-none-any.whl
(3.9 kB
view hashes)