Skip to content

Tenn-Explorations/mpesa-bridge-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mpesa-bridge-python

A python client library for mpesa_bridge

How it works

We have abstracted all the integrations stuff and all that is left for you to do is a one line call

response = client.request_payment(1000, "2547xxxxxxxx")

Well, there is small configuration before then. Let us take you through:

usage

To use mpes_bridge python library, you can install it via pip (recommended).

pip install git+https://github.com/Tenn-Explorations/mpesa-bridge-python

After cloning, import it into your project and initialize the client:

from mpesa_bridge.client import Client

# it is recommended that you load these to variables from .env
BASE_URL = "https://weprocesspayments.ink"
API_KEY = "YOUR_API_KEY"

client = Client(api_key=API_KEY, base_url=BASE_URL)

Now you are ready to perform transactions.

# NB: The first parameter for request payment is amount of money IN CENTS you want to charge.
response = client.request_payment(2000, "2547XXXXXXXX")

print(response)

A full example is available on the examples/ folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages