Skip to main content

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


Download files

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

Source Distribution

pyrx_payment_sdk-0.1.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

pyrx_payment_sdk-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for pyrx_payment_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f2dc9fa5a75619cb2045abd3954b8d7e7784017be39855d37b76f9ec12c772cd
MD5 b167d0ef9bae56881d415ffd8bb671fa
BLAKE2b-256 e42b5d67e6a46ce517a739ffd07de22a0ed23947772782a8f05d112373d372e8

See more details on using hashes here.

File details

Details for the file pyrx_payment_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyrx_payment_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 950e17b0248b10031093365331e83c89338529761908ccfe5bc4fafcebda10d4
MD5 e0e0849c1df006ac7b979cf7ab7bfab9
BLAKE2b-256 0695b33db6ea0c3badd9357c78891bf422949ab3b2157ba56c3aee3bccd33830

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