Skip to main content

Square billing provider for the Swarmauri SDK.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_billing_square

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


Download files

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

Source Distribution

swarmauri_billing_square-0.9.3.dev3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_billing_square-0.9.3.dev3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_billing_square-0.9.3.dev3.tar.gz.

File metadata

  • Download URL: swarmauri_billing_square-0.9.3.dev3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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

Hashes for swarmauri_billing_square-0.9.3.dev3.tar.gz
Algorithm Hash digest
SHA256 9d29080fc5041e761536e392178ac5087f46e2633f45c9d88f584699020b0304
MD5 18da76a4a52132c07d6e13f5e9fb5641
BLAKE2b-256 2d7bd6145ac539be8b783236ab3514de4fa401db819ccd459ea276e1d0701244

See more details on using hashes here.

File details

Details for the file swarmauri_billing_square-0.9.3.dev3-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_billing_square-0.9.3.dev3-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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

Hashes for swarmauri_billing_square-0.9.3.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 e79715f5584f94d9c27b86e607113c62a704f20e59c290f10ab9290a7d2fe3dc
MD5 b3ba90e8b187f1873dbfd4fe815724ef
BLAKE2b-256 9dbd45e240f939daa83453bea7911e9cb675e265449b92d3a730dc6ca964d0bd

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