A Python package for interacting with selected Jenga API endpoints.
- Reads configuration from environment variables
- Generates access tokens
- Signs request values with your RSA private key using
cryptography - Provides both Python and CLI usage
pip install paymentsdks-jengaThe package reads configuration from environment variables. The required variables are:
JENGA_API_KEY=
JENGA_MERCHANT_CODE=
JENGA_CONSUMER_SECRET=
JENGA_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nreplace-with-private-key\n-----END PRIVATE KEY-----"
JENGA_LIVE_MODE=falseGenerate an RSA key pair with OpenSSL before setting JENGA_PRIVATE_KEY:
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in private_key.pem -out public_key.pem- Save the contents of
private_key.peminJENGA_PRIVATE_KEY. - Save the contents of
public_key.pemin the Jenga dashboard under the Keys section.
[!INFO]
JENGA_LIVE_MODE=trueuseshttps://api.finserve.africawhiteJENGA_LIVE_MODE=falseuseshttps://uat.finserve.africa- For PEM values, you can use either real multiline values or
\n-escaped text in.envfiles.
If you are using a local .env file, load it into your shell before running commands:
Request signing is handled internally by JengaClient before protected endpoint calls are made.
If you need to generate a signature manually:
from jenga import JengaClient
client = JengaClient.from_env()
signature = client.sign("KE", "1450160649886")The data is signed in the order it is passed.
Use the package directly in your application code.
from jenga import JengaClient
client = JengaClient.from_env()
balance = client.account_balance(
country_code="KE",
account_id="1450160649886",
)
statement = client.mini_statement(
country_code="KE",
account_id="1450160649886",
)4.1.1 Account Balance
Python:
from jenga import JengaClient
client = JengaClient.from_env()
result = client.account_balance(country_code="KE", account_id="1450160649886")
print(result)CLI:
PYTHONPATH=src python3 -m jenga.cli account-balance --country-code KE --account-id 14501606498864.1.2 Account Mini Statement
Python:
from jenga import JengaClient
client = JengaClient.from_env()
result = client.mini_statement(country_code="KE", account_id="1450160649886")
print(result)CLI:
PYTHONPATH=src python3 -m jenga.cli mini-statement --country-code KE --account-id 1450160649886- Account Full Statement
- Opening and Closing Account Balance
- Account Inquiry - Bank Accounts
- Within Equity Bank
- To Mobile Wallets
- RTGS
- SWIFT
- Pesalink - To Bank Account
- Pesalink - To Mobile Number
- IMT Within Equity Bank
- IMT to Mobile Wallets
- IMT Pesalink - To Bank Account
- IMT Pesalink - To Bank Mobile
- Receive Payments - Bill Payments
- Receive Payments - Merchant Payments
- Bill Validation
- Get All EazzyPay Merchants
- Query Transaction Details
- Get All Billers
- Purchase Airtime
- Forex Exchange Rates
- ID Search and Verification
- MPGS Validate Payment
- MPGS Authenticate Payment
- MPGS Authorize Payment
- MPGS Query Payment
- MPGS Refund Payment
Run the automated tests:
python3 -m unittest discover -s testsRun a real manual test with your local .env:
set -a
source .env
set +a
PYTHONPATH=src python3 -m jenga.cli account-balance --country-code KE --account-id 1450160649886- This package currently focuses on a small subset of Jenga APIs.
- The README only documents endpoints that are actually implemented in this repository.
- Pending endpoints are listed for roadmap visibility only.
- See the contribution guide for development and pull request workflow.
- Tagged releases matching
v*trigger GitHub Actions to test, build, and publish the package to PyPI automatically. - Example tag:
v0.1.1 - PyPI trusted publishing must be configured once for this repository before the workflow can publish.
License: MIT