Skip to main content

Official Python SDK for the IzichangePay API.

Project description

izichangepay (Python SDK)

Official Python SDK for the IzichangePay API. Zero dependencies (standard library only), Python ≥ 3.8.

pip install izichangepay

Usage

import os
from izichangepay import Client, SANDBOX_BASE_URL

izipay = Client(api_key=os.environ["IZIPAY_API_KEY"])
# Sandbox: Client(api_key=..., base_url=SANDBOX_BASE_URL)

intent = izipay.payment_intents.create({
    "requestedCurrencyType": "fiat",
    "currencyRequested": "XOF",
    "amountRequested": "10000",
    "acceptedCoins": ["USDT.TRC20"],
})
print(intent["paymentUrl"])

Pagination

for intent in izipay.payment_intents.iterate({"limit": 50}):
    print(intent["id"])

Verifying a webhook

from izichangepay import validate_webhook, WebhookError

# `raw_body` must be the raw bytes/str, not a re-serialized dict.
try:
    event = validate_webhook(
        raw_body,
        request.headers.get("X-IziPay-Signature"),
        os.environ["IZIPAY_WEBHOOK_SECRET"],
    )
    # handle event["type"] / event["data"]
except WebhookError as err:
    ...  # reject: err.reason

Errors

All errors subclass IzichangepayError. Specific types: AuthError (401/403), NotFoundError (404), ValidationError (422, .fields), RateLimitError (429, .retry_after), ServerError (5xx), NetworkError, WebhookError.

Features

  • Bearer auth, auto JSON (de)serialization
  • Auto Idempotency-Key on POST, retry on 429/5xx/network with backoff + jitter
  • Constant-time webhook signature verification + anti-replay window
  • Cursor pagination iterators

Documentation

Full reference: https://docs.pay.izichange.com/developers/sdks/python

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

izichangepay-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

izichangepay-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for izichangepay-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23983bd8452a9a99f5df21d3841867e43593dfc023ef48a608b15093c0242a0c
MD5 a2a27de5e8fb59cd18f5737e8b57615a
BLAKE2b-256 9aece32b2d2731266b8d4b977b58da687313015555b5e8cb7358e119a41fa665

See more details on using hashes here.

File details

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

File metadata

  • Download URL: izichangepay-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for izichangepay-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e73e010f00ac18a140e49d7178d2c4fa6fbc91dc110b98071246cdf35413788f
MD5 8d7c1d3eb101c76a9955d7950daad541
BLAKE2b-256 9e7cbd49b8ae6c73b98a7da93117cdf089727f590abcd8df8ad3375be98d7c9d

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