Skip to main content

Hyperswitch Payments SDK — Python client for connector integrations via UniFFI FFI

Project description

Python Payments SDK

Calls the connector FFI layer directly from Python using protobuf-encoded bytes, bypassing gRPC. Uses UniFFI-generated Python bindings.

Prerequisites

  • Rust toolchain (cargo)
  • Python 3.9+
  • protoc (Protocol Buffers compiler)

Setup

# Build Rust lib, generate UniFFI bindings and proto stubs, build wheel
make pack

Test

# Verify the packed wheel installs and the FFI layer works end-to-end
make test-pack

# With full round-trip (requires valid Stripe test key)
STRIPE_API_KEY=sk_test_your_key make test-pack

test-pack installs the wheel into an isolated temp directory and runs test_smoke.py, which asserts the connector request URL and method, then optionally exercises the full HTTP round-trip if STRIPE_API_KEY is set.

Distribution

# Build wheel containing all available platform binaries (for CI / release)
make dist
# → artifacts/sdk-python/hyperswitch_payments-0.1.0.whl

How it works

  1. make build-lib — builds crates/ffi/ffi with --features uniffi
  2. make generate-bindings — runs uniffi-bindgen to produce generated/connector_service_ffi.py
  3. make generate-proto — runs grpc_tools.protoc to produce generated/payment_pb2.py
  4. make pack-archive — runs pip wheel to produce the installable .whl

ConnectorClient

connector_client.py provides a high-level ConnectorClient class that handles:

  1. Serialize protobuf request to bytes
  2. Call authorize_req via FFI to get the connector HTTP request
  3. Execute the HTTP request using requests
  4. Call authorize_res via FFI to parse the connector response
  5. Deserialize the protobuf response

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

hs_paylib-0.0.3-py3-none-any.whl (21.1 MB view details)

Uploaded Python 3

File details

Details for the file hs_paylib-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: hs_paylib-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for hs_paylib-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8244cf2b92091911f9b7c09a320c57eef352e68fe0aecd54cf0c70df57891619
MD5 f871d9e18223e8ec385feb40be390859
BLAKE2b-256 573726f60b0d30240fbed25634839bdc80f6078059df959fc112ce082b97a5a9

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