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="testing/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.0.tar.gz
(9.3 kB
view hashes)
Built Distribution
Close
Hashes for python_jengaapi-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8edd0b41932e980681aa22b02df261e7e322ecd1e4c6c465aa2bbc5f397e6276 |
|
MD5 | 196e76668f75af972b09fe5c12a1547d |
|
BLAKE2b-256 | ef892498b01138b9fd41308d332064c5f15ed11e1e09fb0064172155fc8ebabd |