Skip to main content

Minimal Python client for selected Jenga APIs

Project description

jenga

A minimal Python package for interacting with selected Jenga API endpoints.

Implemented endpoints:

  • account-balance
  • mini-statement

Implemented features:

  • Reads configuration from environment variables
  • Generates access tokens
  • Signs request values with your RSA private key using cryptography
  • Provides both Python and CLI usage

Pending endpoints are listed later in this document.

1. Installation

pip install paymentsdks-jenga

2. Configuration

The 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=false

[!INFO]

  • JENGA_LIVE_MODE=true uses https://api.finserve.africa white JENGA_LIVE_MODE=false uses https://uat.finserve.africa
  • For PEM values, you can use either real multiline values or \n-escaped text in .env files.

If you are using a local .env file, load it into your shell before running commands:

3. Usage

3.1 Signature generation

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.

3.1 Python usage

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. Endpoint Coverage

4.1 Account Services

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 1450160649886
4.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

4.2 Send Money

  • Within Equity Bank
  • To Mobile Wallets
  • RTGS
  • SWIFT
  • Pesalink - To Bank Account
  • Pesalink - To Mobile Number

4.3 Send Money - IMT

  • IMT Within Equity Bank
  • IMT to Mobile Wallets
  • IMT Pesalink - To Bank Account
  • IMT Pesalink - To Bank Mobile

4.4 Receive Money

  • Receive Payments - Bill Payments
  • Receive Payments - Merchant Payments
  • Bill Validation

4.5 Receive Money Queries

  • Get All EazzyPay Merchants
  • Query Transaction Details
  • Get All Billers

4.6 Airtime

  • Purchase Airtime

4.7 Forex Rates

  • Forex Exchange Rates

4.8 ID Search and Verification

  • ID Search and Verification

4.9 MPGS Direct Integration

  • MPGS Validate Payment
  • MPGS Authenticate Payment
  • MPGS Authorize Payment
  • MPGS Query Payment
  • MPGS Refund Payment

5. Testing

Run the automated tests:

python3 -m unittest discover -s tests

Run 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

6. Notes

  • 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.

7. License

License: MIT

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

paymentsdks_jenga-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paymentsdks_jenga-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file paymentsdks_jenga-0.1.0.tar.gz.

File metadata

  • Download URL: paymentsdks_jenga-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for paymentsdks_jenga-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a382f64c043477775455d3da8e4baa171a046d1627c86fa400f2d6043024421
MD5 00ee74c1e2518a1cecbc19502494d2bc
BLAKE2b-256 edccd4731586df6a02a96bfdbed2d5fdf33b1f9a866332c3765937fc27c1a9c3

See more details on using hashes here.

File details

Details for the file paymentsdks_jenga-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for paymentsdks_jenga-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7593c9ae201c734d7b3821877c69ae8ab4f996fd7b5cf236f4a3b33ae4cd4b0
MD5 a8f0418d2b8823622bdcc29a240f97a0
BLAKE2b-256 c66d4c2d00e81c8ded90e82478fe30dfc93567e9e2611b7e4e350c3451d94336

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page