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
make build-lib— buildscrates/ffi/ffiwith--features uniffimake generate-bindings— runsuniffi-bindgento producegenerated/connector_service_ffi.pymake generate-proto— runsgrpc_tools.protocto producegenerated/payment_pb2.pymake pack-archive— runspip wheelto produce the installable.whl
ConnectorClient
connector_client.py provides a high-level ConnectorClient class that handles:
- Serialize protobuf request to bytes
- Call
authorize_reqvia FFI to get the connector HTTP request - Execute the HTTP request using
requests - Call
authorize_resvia FFI to parse the connector response - 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8244cf2b92091911f9b7c09a320c57eef352e68fe0aecd54cf0c70df57891619
|
|
| MD5 |
f871d9e18223e8ec385feb40be390859
|
|
| BLAKE2b-256 |
573726f60b0d30240fbed25634839bdc80f6078059df959fc112ce082b97a5a9
|