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)
- 🔄 FastAPI 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 fastapi import FastAPI
from oxapay.webhook import WebhookRouter, PaymentWebhookEvent
app = FastAPI()
webhook = WebhookRouter(
app=app,
merchant_api_key="your_key",
path="/webhook"
)
@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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oxapay-0.3.0.tar.gz
(125.9 kB
view details)
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
oxapay-0.3.0-py3-none-any.whl
(23.2 kB
view details)
File details
Details for the file oxapay-0.3.0.tar.gz.
File metadata
- Download URL: oxapay-0.3.0.tar.gz
- Upload date:
- Size: 125.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5235daf8e91faa4e4ce1065aa51abba6b1fe0976eedfa3f30eb029f28f7af6a4
|
|
| MD5 |
927a5de43e03cb3f3faf2d5c0fcc3ad7
|
|
| BLAKE2b-256 |
4e8c9593d438e508b2ab1d42ee6ddef78180082bd509ba989c09d64d5cd6d864
|
File details
Details for the file oxapay-0.3.0-py3-none-any.whl.
File metadata
- Download URL: oxapay-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e0c5fedc4f322552946cb7464d547ccb9dc05f6f6b12854073b5062565f3d03
|
|
| MD5 |
4b5b50c9ceb8d0e6fffb35d56efa4048
|
|
| BLAKE2b-256 |
03e21cd3104f878d374b03c302041334d03cd329566615495d76609faaad84e7
|