Skip to main content

Von Payments Checkout SDK for Python

Project description

vonpay-checkout

Python SDK for the Von Payments Checkout API. Create hosted checkout sessions, verify webhook signatures, and validate signed return redirects.

Install

pip install vonpay-checkout

Requires: Python 3.9+, httpx 0.27+

Quick start

from vonpay.checkout import VonPayCheckout, VonPayError

client = VonPayCheckout("vp_sk_test_...")

session = client.sessions.create(
    amount=1499,
    currency="USD",
    country="US",
    success_url="https://example.com/order/123/confirm",
)

print(session.checkout_url)
# https://checkout.vonpay.com/checkout?session=vp_cs_test_...

Discrete-lifecycle API

The payment_intents, refunds, tokens, and capabilities namespaces give server-side control over payment intents, alongside the existing hosted-checkout sessions flow.

# Create a payment intent (auth + capture)
intent = client.payment_intents.create(
    amount=1499,
    currency="usd",
    capture_method="automatic",
    metadata={"order_id": "ord_42"},
    idempotency_key="ord_42-charge-1",
)
print(intent.id, intent.status)  # "vpi_live_…", "succeeded"

# Auth-only + later capture (fulfillment-on-ship)
auth = client.payment_intents.create(amount=1499, currency="usd", capture_method="manual")
client.payment_intents.capture(auth.id, amount_to_capture=1499)

# Refund a captured intent (partial or full)
refund = client.refunds.create(payment_intent=intent.id, amount=500)

# Create a reusable token for save-card / MIT flows
token = client.tokens.create(buyer_id="buyer_42", setup_for_future_use="off_session")

# Read the merchant's processor capability matrix before invoking optional ops
caps = client.capabilities.get()
if caps.supported_operations.partial_refund:
    # partial refunds supported — safe to offer partial-refund UI
    ...

Features

  • Typed session / webhook / error objects — full CheckoutSession, SessionStatus, WebhookEvent, VonPayError types.
  • Webhook verification — HMAC-SHA256 with ±5 minute timestamp replay protection.
  • Signed return URL verification (v1 + v2)verify_return_signature() supports both legacy v1 signatures and v2 signatures that bind successUrl, keyMode, and iat freshness.
  • Auto-retry — exponential backoff on 429 / 5xx with Retry-After header support.
  • Request ID tracing — every response includes X-Request-Id for support tickets.

Documentation

License

MIT

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

vonpay_checkout-0.8.0.tar.gz (55.8 kB view details)

Uploaded Source

Built Distribution

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

vonpay_checkout-0.8.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file vonpay_checkout-0.8.0.tar.gz.

File metadata

  • Download URL: vonpay_checkout-0.8.0.tar.gz
  • Upload date:
  • Size: 55.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vonpay_checkout-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f3f60866da3d8b0a716fb6821a62aea631e54c09a9bec8f8f8dc44437396155f
MD5 074bf593d001765b8e6b5a026516eb9b
BLAKE2b-256 adcfdf7a9fd700b06b63a46f8b7b49af03d8b76694d5b52521a64455980fbaa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vonpay_checkout-0.8.0.tar.gz:

Publisher: publish-pypi.yml on Von-Payments/vonpay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vonpay_checkout-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: vonpay_checkout-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vonpay_checkout-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b69973cc52dc690f2a96abb3e16da9da31e95131acf0b638b2304e25ce6e555
MD5 17e1ce91b665631f6166fcd29994bb68
BLAKE2b-256 d46cc7cf09fd59b70001d94dd2794c8b459cb7ee79d5ed05540c10cf2871b648

See more details on using hashes here.

Provenance

The following attestation bundles were made for vonpay_checkout-0.8.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Von-Payments/vonpay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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