PayPal billing provider for the Swarmauri SDK.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_billing_paypal-0.1.3.dev2.tar.gz.
File metadata
- Download URL: swarmauri_billing_paypal-0.1.3.dev2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ec769b3ca59fad383a8ad5c042bc16f85a49f214363f37b15ffe8c8f6c1cac
|
|
| MD5 |
4ee493024b3a080a4ffa747f41e495d6
|
|
| BLAKE2b-256 |
275b453e5cf2bd2859af411633e016ea01976de0fb2dea6d18d9047011f962f4
|
File details
Details for the file swarmauri_billing_paypal-0.1.3.dev2-py3-none-any.whl.
File metadata
- Download URL: swarmauri_billing_paypal-0.1.3.dev2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6cdd4d24ea8461161b639fb74425ce214482ec3e5104f1aee7262f3fde6bb42
|
|
| MD5 |
22db61aa46c2662187a33a8e1aee3944
|
|
| BLAKE2b-256 |
8c431238192460d992b4b572de33a5d988dfed404b2a3d7134116c5970886438
|