Metadata-Version: 2.4
Name: platega
Version: 0.1.5
Summary: A comprehensive Python library for the Platega.io API
Project-URL: Documentation, https://github.com/komarukomaru/platega#readme
Project-URL: Issues, https://github.com/komarukomaru/platega/issues
Project-URL: Source, https://github.com/komarukomaru/platega
Author-email: Komaru <hov656985@gmail.com>
License-Expression: MIT
Keywords: api,async,httpx,payments,platega
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: httpx>=0.23.0
Requires-Dist: pydantic>=2.0.0
Description-Content-Type: text/markdown

# Platega API Library

A comprehensive Python library for interacting with the Platega.io API.

## Features

- Full support for all Platega API endpoints (Payments, Rates, etc.)
- Synchronous and Asynchronous clients
- Pydantic models for request/response validation
- Webhook handler with decorator support
- Type hinting

## Installation

```bash
pip install platega
```

## Usage

### Synchronous Client

```python
from platega import PlategaClient

client = PlategaClient(merchant_id="your-uuid", secret_key="your-secret")

status = client.check_invoice("transaction-uuid")
print(status)
```

### Asynchronous Client

```python
import asyncio
from platega import AsyncPlategaClient

async def main():
    client = AsyncPlategaClient(merchant_id="your-uuid", secret_key="your-secret")
    async with client:
        status = await client.check_invoice("transaction-uuid")
        print(status)

asyncio.run(main())
```

### Webhooks

```python
from platega import PlategaWebhookHandler, PaymentStatus

handler = PlategaWebhookHandler()

@handler.on(PaymentStatus.CONFIRMED)
async def handle_confirmed(payload):
    print(f"Payment confirmed: {payload.id}")

# In your web framework (e.g., FastAPI/Flask)
# handler.process_webhook(request_json)
```
