Square billing provider for the Swarmauri SDK.
Project description
Swarmauri Billing Square
The Swarmauri Billing Square package delivers a Square-backed billing provider that speaks the Swarmauri billing interfaces. It uses the official Square Python SDK to manage catalog items, hosted checkout links, card-not-present payments, subscriptions, and invoices.
Features
- ✅ Turns Square catalog items and variations into Swarmauri product and price references.
- ✅ Generates hosted checkout links through the Payments API Link service.
- ✅ Supports payment intents, captures, and cancellations using Square's server APIs.
- ✅ Manages subscriptions and invoices, including publishing and cancellation flows.
- ✅ Surfaces marketplace fee splits and dispute listings for downstream automation.
Installation
pip install swarmauri_billing_square
uv add swarmauri_billing_square
Usage
from swarmauri_billing_square import SquareBillingProvider
from swarmauri_base.billing import CheckoutRequest, PriceSpec, ProductSpec
provider = SquareBillingProvider(
access_token="sq0atp-...",
location_id="L8899XYZ",
)
product = provider.create_product(
ProductSpec(name="Digital Membership", description="Premium access"),
idempotency_key="prod-square-001",
)
price = provider.create_price(
product,
PriceSpec(currency="USD", unit_amount_minor=2500, nickname="Monthly"),
idempotency_key="price-square-001",
)
checkout = provider.create_checkout(
price,
CheckoutRequest(
quantity=1,
success_url="https://merchant.example/success",
cancel_url="https://merchant.example/cancel",
idempotency_key="checkout-square-001",
),
)
print(product.id, price.id, checkout.url)
Capability Mapping
Square capabilities advertised by this provider map to swarmauri_core.billing.Capability. Use capabilities_to_tigrbl to translate capabilities to the tigrbl billing vocabulary when required.
Contributing
Community improvements are welcome! Enhancements that broaden Square API coverage or harden error handling are greatly appreciated.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 swarmauri_billing_square-0.9.2.dev23.tar.gz.
File metadata
- Download URL: swarmauri_billing_square-0.9.2.dev23.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be312fd49bb7c84d5e9ba4546e047f00149a166149afc5483a5b852f27dbccc8
|
|
| MD5 |
159b3d7e487aa1408ec73e262727935a
|
|
| BLAKE2b-256 |
5ca4821c01bc19b33b882268f06d9525dcabf839af8b38671643236a7e5aa1fe
|
File details
Details for the file swarmauri_billing_square-0.9.2.dev23-py3-none-any.whl.
File metadata
- Download URL: swarmauri_billing_square-0.9.2.dev23-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f954ed9780bc6c0350f3a22697cd68fe62a79c10a63e59fdc3e638da0e3829ac
|
|
| MD5 |
02ee947599a326b23e2a4bb33bf3a76a
|
|
| BLAKE2b-256 |
806033886ad099b05e1ec2207484537d6e812a38dd9a1a89a0ca2266426a7651
|