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.2.tar.gz (8.9 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.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_billing_paypal-0.1.2.tar.gz.

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.2.tar.gz
Algorithm Hash digest
SHA256 f075df455a91dbc70a448eec47d0ac2e358b5f1e1f7a991aa531db4ba7573b3f
MD5 75f556e59e79bfd0b98f5b0a306f42ce
BLAKE2b-256 1b8579cf9a5a056dd369dd03332313b5027f01b66d0faff2bdae7f38727215a3

See more details on using hashes here.

File details

Details for the file swarmauri_billing_paypal-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24ccef773349e35af5b9fb1ad7609033f202aaea22993fd0ad361a9af4f3c47e
MD5 6f187b61fe64f14598b79365af0d2fdf
BLAKE2b-256 3dbfd39194a36d123c2b84a7f52e770c74e0ea7e7d91c8683861f734ebb53a42

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