A fully-typed asynchronous Python client for interacting with the OxaPay cryptocurrency payment gateway.
Project description
OxaPay Python Client
A fully-typed Python client for the OxaPay cryptocurrency payment gateway v1 API.
Features
- 🚀 Async-first with sync wrapper
- 🔒 Full type hints & Pydantic models
- 🌐 Complete API coverage (Merchant, Payout, Swap, System)
- 🔄 Litestar webhook integration
Installation
pip install oxapay
For webhook handling:
pip install "oxapay[webhook]"
Quick Start
Create an Invoice
import asyncio
from oxapay import OxaPayClient, CreateInvoiceRequest
async def main():
async with OxaPayClient(merchant_api_key="your_key") as client:
invoice = CreateInvoiceRequest(
amount=100,
currency="USD",
order_id="order_123"
)
response = await client.create_invoice(invoice)
print(f"Payment URL: {response.data.payment_url}")
print(f"Track ID: {response.data.track_id}")
asyncio.run(main())
Sync Client
from oxapay.sync import SyncOxaPayClient, CreateInvoiceRequest
client = SyncOxaPayClient(merchant_api_key="your_key")
response = client.create_invoice(
CreateInvoiceRequest(amount=100, currency="USD")
)
print(response.data.payment_url)
Webhooks
from litestar import Litestar
from oxapay.webhook import WebhookRouter, PaymentWebhookEvent
webhook = WebhookRouter(
merchant_api_key="your_key",
path="/webhook"
)
app = Litestar(route_handlers=[webhook.router])
@webhook.on_payment_paid
async def handle_payment(event: PaymentWebhookEvent):
print(f"Payment received: {event.track_id}")
API Coverage
- Merchant: Invoices, white-label, static wallets, payment info
- Payout: Send crypto, track payouts, balances
- Swap: Exchange rates, swap requests
- System: Prices, currencies, networks, status
Examples
See the examples/ directory for more detailed usage patterns.
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oxapay_litestar-0.3.2.tar.gz.
File metadata
- Download URL: oxapay_litestar-0.3.2.tar.gz
- Upload date:
- Size: 146.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d85b49bd5bd3e7f87b76b927377d9ee9f61e2e9d255afc91f490536cc4716e66
|
|
| MD5 |
21739b8f37a1cdf25184fda84cd4b0ff
|
|
| BLAKE2b-256 |
18083bef418a97aeaea0666401c21b5cb6fbd80c58d1cb7286904623da90fd7e
|
File details
Details for the file oxapay_litestar-0.3.2-py3-none-any.whl.
File metadata
- Download URL: oxapay_litestar-0.3.2-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
949ca71c9f80fea2d32e4234e58169bba69c3e89c462d933bba1f27db14a8a9f
|
|
| MD5 |
dcc45826f1af7857cd6300bae40e3fc8
|
|
| BLAKE2b-256 |
b3e94d98d5db7141a5fa86e8c41fff3072976da10046b8f19fcf96c59bc9faca
|