Skip to main content

A Typed Python client for the Pesapal API with sync/async support, order submission, IPN management, and optional CLI tools.

Project description

pesapal-client

Release Build status Commit activity License

A Typed Python client for the Pesapal API with sync/async support, order submission, IPN management, and optional CLI tools.


Features

  • Typed models for requests and responses using Pydantic
  • Sync and async API support
  • Order submission and payment status tracking
  • IPN (Instant Payment Notification) management
  • Subscription management
  • Automatic authentication and token refresh
  • Custom exceptions for error handling
  • Utility functions for JWT and JSON parsing
  • Optional CLI tools for quick integration

Installation

pip install pesapal-client

Quick Start

from pesapal_client.client import PesapalClientV3
from pesapal_client.v3.schemas import InitiatePaymentOrderRequest

client = PesapalClientV3(
    consumer_key="your_consumer_key",
    consumer_secret="your_consumer_secret",
    is_sandbox=True,
)

payment_request = InitiatePaymentOrderRequest(
    amount="1000",
    currency="KES",
    description="Test payment",
    # ...other required fields...
)

response = client.one_time_payment.initiate_payment_order(payment_request)
print(response.redirect_url)

Documentation


License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pesapal_client-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

pesapal_client-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pesapal_client-0.1.1.tar.gz.

File metadata

  • Download URL: pesapal_client-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for pesapal_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7f5f8efd653ec406777a357ec78533c7e4e940ae3427d08d94bc865456ed601b
MD5 275d45ab95df1ac8c9076206e8699f99
BLAKE2b-256 12a29d3de6ef7e5ee824b0200c9231c9a818ff82a3ff0bb21673944c2b8b30be

See more details on using hashes here.

File details

Details for the file pesapal_client-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pesapal_client-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.13 Linux/6.11.0-1018-azure

File hashes

Hashes for pesapal_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d0873c2c05d4fa33fbf86ad189265995065bd901f41b8083e62dd5427aeabee
MD5 0e0291b49ff8c29487e5ce0d9f0f5835
BLAKE2b-256 61a4998b45a131227fb753d4983cc7dc89344363d3b84dcaf838e2eb7f74877d

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