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.dev2.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.dev2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swarmauri_billing_square-0.9.3.dev2.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.dev2.tar.gz
Algorithm Hash digest
SHA256 f92227bb7b2a2327f0e97897b8033825b2c2e3458b6672ad2cb520df590b57d1
MD5 fd0879eab4b03182232a52713e99e388
BLAKE2b-256 7a7fc3bfd40e67d17774c129f6479051bf3cd2cd6840f5fbeb41a3c5249c0a2f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_billing_square-0.9.3.dev2-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.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 162d19ceeee9700ba3bf98084c91bd44cd955af010bca3d78a0a009b583036fa
MD5 940ec5655dfef093e08c6ff36ee9c2bd
BLAKE2b-256 b77e55065a3a909e0b808df2e051bc7291cbddd5031fd3b8eba8fb42dd3a2c11

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