Metadata-Version: 2.4
Name: pyrx-payment-sdk
Version: 0.1.0
Summary: Python SDK for PYRX Payment Service — async client for payments, subscriptions, and refunds
Project-URL: Repository, https://github.com/pyrx/pyrx-payment
Project-URL: Documentation, https://github.com/pyrx/pyrx-payment/blob/master/docs/integration-guide.md
Author: PYRX Team
License: MIT
Keywords: async,payment,paypal,sdk,stripe
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Description-Content-Type: text/markdown

# pyrx-payment-sdk

Python SDK for the PYRX Payment Service. Provides an async client for creating payments, managing subscriptions, processing refunds, and verifying webhooks.

## Installation

```bash
pip install pyrx-payment-sdk
```

## Quick Start

```python
import asyncio
from decimal import Decimal
from pyrx_payment_sdk import PaymentClient

async def main():
    client = PaymentClient(
        api_key="pyrx_lv_sk_your_key_here",
        base_url="https://pay.pyrx.ai",
    )

    # Create a payment
    payment = await client.payments.create(
        amount=Decimal("29.99"),
        currency="USD",
        payment_method_type="card",
        provider="stripe",
    )
    print(f"Checkout URL: {payment.checkout_url}")

    # List subscriptions
    subs = await client.subscriptions.list(status="active")

    # Verify a webhook
    is_valid = client.webhooks.verify(
        payload=request_body,
        signature=request.headers["X-Pyrx-Signature"],
        secret="your_webhook_secret",
    )

    await client.close()

asyncio.run(main())
```

## Supported Operations

- **Payments**: create, get, capture, cancel, list
- **Subscriptions**: create, get, update, cancel, pause, resume, list
- **Refunds**: create, get
- **Webhooks**: verify signature, parse event
