Skip to main content

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 verificationwebhooks.construct_event(raw_body, signature_header, signing_secret) parses the x-vonpay-signature: t=<unix>,v1=<hex> header, verifies HMAC-SHA256 over f"{t}.{raw_body}" keyed by your per-endpoint signing secret (whsec_…), and enforces the freshness window (≤5 min old / ≤30 sec future). Accepts multiple v1= entries for zero-downtime secret rotation.
  • Return confirmationclient.sessions.confirm_return(params, session_secret) verifies the signature and confirms server-side that the payment succeeded, returning ReturnOutcome(paid, signature_valid, status, reason). Use this, and branch on paid. ⚠️ verify_return_signature() is the low-level primitive: it proves the message is AUTHENTIC, and a declined payment is signed just as validly, so a true from it is not proof of payment. ⚠️ reason == "still_pending" means the charge is in flight (the ordinary 3-D Secure case) — show a neutral "confirming your payment", never a failure. ⚠️ paid: true still does not mean safe to fulfil: record which session IDs you have already fulfilled, and prefer fulfilling from the charge.succeeded webhook. ⚠️ Not session.succeeded — that event is emitted internally but is not subscribable: it is absent from the merchant subscription catalog, which accepts an unknown event key, stores nothing and returns success. An endpoint subscribed to it receives nothing, forever, with no error raised at any layer. charge.succeeded is the fulfilment event.
  • 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

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-1.1.0.tar.gz (73.0 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-1.1.0-py3-none-any.whl (64.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vonpay_checkout-1.1.0.tar.gz
  • Upload date:
  • Size: 73.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vonpay_checkout-1.1.0.tar.gz
Algorithm Hash digest
SHA256 48c18aa48c9a8f2abd874631e6050dc901b70fe1229467229feeeffc036f2b9b
MD5 682f5b9027f072bebfa9ac3fe6aaf059
BLAKE2b-256 ed0f98046eb96a971423ed90b890372f10dae554404451d31c0d90a433ced1e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vonpay_checkout-1.1.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-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: vonpay_checkout-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vonpay_checkout-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b2fc9fde3adbd97a524d184d041e6655d08ab2f1dc177dfb5915f2dc9cdcc2f
MD5 90703df9c56776acf6f7af44b25011b8
BLAKE2b-256 ea0c34b76661340ae33e76f6a06da7a463e417e0a6619efd6efe562a29912b03

See more details on using hashes here.

Provenance

The following attestation bundles were made for vonpay_checkout-1.1.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.

Release history Release notifications | RSS feed

1.1.1

2 files

This release

1.1.0 This release

2 files

1.0.0

2 files

0.15.1

2 files

0.15.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.2

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page