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

Uploaded Python 3

File details

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

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.2.dev23.tar.gz
  • Upload date:
  • Size: 8.9 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

Hashes for swarmauri_billing_paypal-0.1.2.dev23.tar.gz
Algorithm Hash digest
SHA256 a44c2eaa6da0d906b0f9e15ad9fca0713c854e6f57cb6419effee4af4c84e9be
MD5 0d8d01f7964f33aefcdb321b6d0e46db
BLAKE2b-256 b7df3c818f47abc8b187e1718dcab7ecfe2cb087d7c59fe9dc6a4949698ccc82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_billing_paypal-0.1.2.dev23-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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

Hashes for swarmauri_billing_paypal-0.1.2.dev23-py3-none-any.whl
Algorithm Hash digest
SHA256 035da93c204196c570944b73f246b99ad33ba7c605adf112b25963e202175d9e
MD5 67513dd197ef33e6c8326a7502dcaf1f
BLAKE2b-256 c2d843dc826bbef4ffae17691016c76a56a346dc0e5ba4ca9a666ed0e8dfdcb2

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