Metadata-Version: 2.4
Name: izichangepay
Version: 0.1.0
Summary: Official Python SDK for the IzichangePay API.
Project-URL: Documentation, https://docs.pay.izichange.com/developers/sdks/python
Project-URL: Homepage, https://docs.pay.izichange.com
Author: IzichangePay
License: MIT
Keywords: africa,crypto,izichangepay,izipay,payments,sdk
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# izichangepay (Python SDK)

Official Python SDK for the [IzichangePay](https://docs.pay.izichange.com) API. Zero dependencies (standard library only), Python ≥ 3.8.

```bash
pip install izichangepay
```

## Usage

```python
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

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

### Verifying a webhook

```python
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
