Skip to main content

PayPal billing provider for the Swarmauri SDK.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_billing_paypal

Swarmauri Billing PayPal

The Swarmauri Billing PayPal package delivers a PayPal-oriented billing provider that complies with Swarmauri's billing abstractions. It focuses on hosted checkout, direct captures, subscriptions, invoicing, payouts, and webhook parsing so PayPal integrations can be developed without re-learning the Swarmauri interfaces.

Features

  • ✅ Generates deterministic IDs and payload echoes to keep local testing predictable.
  • ✅ Covers PayPal's core primitives: products, plans, hosted checkout sessions, invoices, refunds, customers, payment methods, payouts, and reports.
  • ✅ Returns serializable dictionaries that map cleanly onto Swarmauri billing references and capability checks.
  • ✅ Ships as a standalone package that can be swapped for real PayPal SDK logic when you are production ready.

Installation

Install from PyPI using either pip or uv:

pip install swarmauri_billing_paypal
uv add swarmauri_billing_paypal

Usage

from swarmauri_billing_paypal import PayPalBillingProvider
from swarmauri_base.billing import CheckoutRequest, ProductSpec, PriceSpec

provider = PayPalBillingProvider(api_key="sandbox-secret")

product = provider.create_product(
    ProductSpec(payload={"name": "Workspace"}),
    idempotency_key="paypal-prod-1",
)
price = provider.create_price(
    product,
    PriceSpec(payload={"currency": "USD", "unit_amount_minor": 2500}),
    idempotency_key="paypal-price-1",
)
checkout = provider.create_checkout(
    price,
    CheckoutRequest(payload={"success_url": "https://example.com/return"}),
)

print(product.id, price.id, checkout.url)

Capability Mapping

Capabilities reported by the provider are translated to tigrbl_billing semantics with swarmauri_core.billing.capabilities_to_tigrbl. This allows the stub to coexist with production-grade PayPal SDK implementations while sharing tests and feature flags.

Contributing

Pull requests that replace the stubbed responses with actual PayPal REST API calls are encouraged. Please include reproducible examples and documentation updates when expanding functionality.

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_paypal-0.1.3.dev3.tar.gz (9.0 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_paypal-0.1.3.dev3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_billing_paypal-0.1.3.dev3.tar.gz.

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.3.dev3.tar.gz
  • Upload date:
  • Size: 9.0 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_paypal-0.1.3.dev3.tar.gz
Algorithm Hash digest
SHA256 9c5c58ac6e84dfca36d5b53be2a8a86512ede8b2d109c66604a2ed7403512d26
MD5 6656cd1bf6d9cf76ca6503571cd699fe
BLAKE2b-256 62d8bf7204466c3988adf4d3d6477088a7a6e2945f6012ae2be3ffe483ae0173

See more details on using hashes here.

File details

Details for the file swarmauri_billing_paypal-0.1.3.dev3-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.3.dev3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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_paypal-0.1.3.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 2022c44c3b8ec7db9cd72a82f823490f470916d0a96f651f0aa8a360b4db66df
MD5 21fd8f30f5ddbd01597b752c668189c5
BLAKE2b-256 c75ca3e1eafcbe44c9ef1baebb4e557f472d4beee34d12abec8abd6d7b86764d

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