A python wrapper for the Jenga API.
Project description
JengaAPIPythonWrapper
A simple python wrapper around the JengaAPI from Equity Bank
Setup
Before beginning add these two environment variables i your .env file:
- BASE_URL="https://yourbaseurl.io" # if non is provided it defaults to https://uat.jengahq.io/
- ENVIRONMENT="production"
SendMoneyService
# Initial Setup
>>> from jengaapi.auth import JengaAPI
>>> API = JengaAPI(api_key="Basic TFZXxx", password="EhPPgRx4ZpxDrrznGdm25d", merchant_code="8995674492", base_url="https://uat.jengahq.io/")
>>> token = API.authorization_token
>>> from jengaapi.send_money_services import SendMoneyService
>>> send_money = SendMoneyService(token=token)
Send within equity
# Generate signature by calling API.signature and passing the relevant tuple (the contents of this tuple are relative based on the request)
# e.g to generate signature for
## generate signature for sending money within equity
>>> signature = API.signature((source_account_number, transfer_amount,currency_code, reference_no))
>>> send_money.send_within_equity(signature, country_code="KE", source_name="John Doe", source_account_number="0770194201783", destination_account_number="0340197385508",destination_name="Jane Doe", transfer_amount="2300.00", currency_code="KES", reference_no="202108211617", transfer_date=date.today(), description="Send Money")
{'transactionId': '202108211618', 'status': 'SUCCESS'}
Send to mobile wallets
>>> signature = API.signature((source_account_number, transfer_amount, currency_code, reference_no))
>>> send_money.send_to_mobile_wallets(signature, wallet_name="Equitel", destination_mobile_number="0763659874", country_code="KE", source_name="John Doe", source_account_number="0770194201783", destination_account_number="0340197385508",destination_name="Jane Doe", transfer_amount="2300.00", currency_code="KES", reference_no="162955567473", transfer_date=date.today(), description="Send Money")
{'transactionId': '162955567473', 'status': 'SUCCESS'}
Send RTGS
>>> signature = API.signature((reference_no, transfer_date.strftime("%Y-%m-%d"), source_account_number, destination_account_number, transfer_amount))
>>> send_money.send_rtgs(signature, destination_account_number="0340197385508", bank_code="01", country_code="KE", source_name="John Doe", source_account_number="0770194201783", destination_name="Jane Doe", transfer_amount="1500.00", currency_code="KES", reference_no="162955622013", transfer_date=date.today(), description="Send Money")
{'transactionId': '000002399997', 'status': 'SUCCESS'}
Send Swift
>>> signature = API.signature((reference_no, transfer_date.strftime("%Y-%m-%d"), source_account_number, destination_account_number, transfer_amount))
>>> send_money.send_rtgs(signature, destination_account_number="0340197385508", bank_code="01", country_code="KE", source_name="John Doe", source_account_number="0770194201783", destination_name="Jane Doe", transfer_amount="1500.00", currency_code="KES", reference_no="162955622013", transfer_date=date.today(), description="Send Money")
{'transactionId': '000002399997', 'status': 'SUCCESS'}
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
python-jengaapi-1.1.1.tar.gz
(9.3 kB
view details)
Built Distribution
File details
Details for the file python-jengaapi-1.1.1.tar.gz
.
File metadata
- Download URL: python-jengaapi-1.1.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da13217d08b636dd4abf3d32eb89b14fa596b52905e7565402e8dac8f0434fa |
|
MD5 | df725bb3fe85f5d1d4bbde333ed22795 |
|
BLAKE2b-256 | 7d8c7ef2e3cc61d097ec8c4377b3f741f92275bc8ae126ed79e03eac0372bfbf |
File details
Details for the file python_jengaapi-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_jengaapi-1.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a4a1d0a70a5869b0859268f89b855639dcd790505097463ca4298ec0fbc60b |
|
MD5 | 5a61aff412c9d22757f0f730c893521d |
|
BLAKE2b-256 | bf60f68fe48703efc6c10c9257ff8c1ce1c997324a2a5d89736419f5fb14cf65 |