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.
Metadata
Release files for swarmauri_billing_paypal 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_billing_paypal-0.1.2.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_billing_paypal-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / swarmauri_billing_paypal-0.1.2.tar.gz
| Download URL | swarmauri_billing_paypal-0.1.2.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f075df455a91dbc70a448eec47d0ac2e358b5f1e1f7a991aa531db4ba7573b3f
|
|
BLAKE2b-256 checksum How to use checksums |
1b8579cf9a5a056dd369dd03332313b5027f01b66d0faff2bdae7f38727215a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / swarmauri_billing_paypal-0.1.2-py3-none-any.whl
| Download URL | swarmauri_billing_paypal-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24ccef773349e35af5b9fb1ad7609033f202aaea22993fd0ad361a9af4f3c47e
|
|
BLAKE2b-256 checksum How to use checksums |
3dbfd39194a36d123c2b84a7f52e770c74e0ea7e7d91c8683861f734ebb53a42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|