Skip to main content

A fully-typed asynchronous Python client for interacting with the OxaPay cryptocurrency payment gateway.

Project description

OxaPay Python Client

PyPI version Python Version License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oxapay_litestar-0.3.2.tar.gz (146.3 kB view details)

Uploaded Source

Built Distribution

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

oxapay_litestar-0.3.2-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

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

Hashes for oxapay_litestar-0.3.2.tar.gz
Algorithm Hash digest
SHA256 d85b49bd5bd3e7f87b76b927377d9ee9f61e2e9d255afc91f490536cc4716e66
MD5 21739b8f37a1cdf25184fda84cd4b0ff
BLAKE2b-256 18083bef418a97aeaea0666401c21b5cb6fbd80c58d1cb7286904623da90fd7e

See more details on using hashes here.

File details

Details for the file oxapay_litestar-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for oxapay_litestar-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 949ca71c9f80fea2d32e4234e58169bba69c3e89c462d933bba1f27db14a8a9f
MD5 dcc45826f1af7857cd6300bae40e3fc8
BLAKE2b-256 b3e94d98d5db7141a5fa86e8c41fff3072976da10046b8f19fcf96c59bc9faca

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