Python SDK for PYRX Payment Service — async client for payments, subscriptions, and refunds
Project description
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
pip install pyrx-payment-sdk
Quick Start
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
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 pyrx_payment_sdk-0.1.0.tar.gz.
File metadata
- Download URL: pyrx_payment_sdk-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2dc9fa5a75619cb2045abd3954b8d7e7784017be39855d37b76f9ec12c772cd
|
|
| MD5 |
b167d0ef9bae56881d415ffd8bb671fa
|
|
| BLAKE2b-256 |
e42b5d67e6a46ce517a739ffd07de22a0ed23947772782a8f05d112373d372e8
|
File details
Details for the file pyrx_payment_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyrx_payment_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
950e17b0248b10031093365331e83c89338529761908ccfe5bc4fafcebda10d4
|
|
| MD5 |
e0e0849c1df006ac7b979cf7ab7bfab9
|
|
| BLAKE2b-256 |
0695b33db6ea0c3badd9357c78891bf422949ab3b2157ba56c3aee3bccd33830
|