Deterministic in-memory Swarmauri billing provider for testing, examples, and full billing capability contract checks.
Project description
Swarmauri Billing Mock
swarmauri_billing_mock provides a deterministic in-memory billing provider for Swarmauri test suites, examples, and provider contract checks. It implements the full Swarmauri billing surface without network calls so applications can exercise products, prices, checkout, payments, subscriptions, invoices, refunds, customers, payment methods, payouts, transfers, reports, webhooks, coupons, and promotions through one predictable provider.
Why Swarmauri Billing Mock?
Use this package when billing code needs repeatable behavior without a real payment processor. It is useful for unit tests, documentation examples, local development, and compatibility checks for code that targets BillingProviderBase and the Swarmauri billing mixins.
FAQ
Q: Does this package call a live billing API?
A: No. The mock provider is intentionally local and deterministic. It returns Swarmauri-shaped billing payloads and never reaches external payment networks.
Q: Which billing capabilities does it advertise?
A: It advertises every Swarmauri billing capability through ALL_CAPABILITIES, including checkout, online payments, subscriptions, invoices, marketplace splits, refunds, customers, payment methods, payouts, balance transfers, reports, webhooks, coupons, and promotions.
Q: When should I use it instead of a real provider?
A: Use it in tests, examples, local workflows, and provider-neutral integration checks. Use Stripe, PayPal, Square, Braintree, Adyen, Authorize.Net, Paystack, or Razorpay packages when code needs a live provider API.
Features
- Implements all billing mixins with predictable outputs.
- Provides fast billing feedback without network calls.
- Supports tests that need all Swarmauri billing capabilities available.
- Demonstrates how to subclass
BillingProviderBasefor custom billing flows. - Supports Python 3.10, 3.11, 3.12, 3.13, and 3.14.
Installation
Install with uv:
uv add swarmauri_billing_mock
Install with pip:
pip install swarmauri_billing_mock
Usage
from swarmauri_billing_mock import MockBillingProvider
from swarmauri_base.billing import ProductSpec
provider = MockBillingProvider(api_key="mock-key")
product = provider.create_product(
ProductSpec(payload={"name": "Test"}),
idempotency_key="mock-prod-1",
)
print(product.raw)
Capability Mapping
The mock provider advertises every Capability and therefore maps to the entire set of tigrbl_billing capabilities when using capabilities_to_tigrbl.
Related Packages
Billing provider packages:
- swarmauri_billing_adyen
- swarmauri_billing_authorize_net
- swarmauri_billing_braintree
- swarmauri_billing_paypal
- swarmauri_billing_paystack
- swarmauri_billing_razorpay
- swarmauri_billing_square
- swarmauri_billing_stripe
Foundational packages:
- swarmauri_core defines billing capabilities and interfaces.
- swarmauri_base provides billing specs, refs, mixins, and
BillingProviderBase. - swarmauri provides namespace imports and plugin discovery.
License
Apache-2.0
Contributing
Need additional fixtures? Contributions that expand deterministic behavior are encouraged.
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_mock-0.11.0.dev2.tar.gz.
File metadata
- Download URL: swarmauri_billing_mock-0.11.0.dev2.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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 |
7d12909d60858698d59aa47e586418d8d12da23c0769d7c96d4039f9f0967cd7
|
|
| MD5 |
387e98923b09ca9156365e35a171a7a9
|
|
| BLAKE2b-256 |
426c6338779c4b824d2f59616226ee91f92eddb4ce7329d5ddd8ead99c58f09f
|
File details
Details for the file swarmauri_billing_mock-0.11.0.dev2-py3-none-any.whl.
File metadata
- Download URL: swarmauri_billing_mock-0.11.0.dev2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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 |
83e30f10908e89435502b6a9eeb6b7cf1959aade9fb28fffaa4efd3a510ca4f2
|
|
| MD5 |
47a269867f451f548a8101a45a7fa29d
|
|
| BLAKE2b-256 |
1d5835fac30f75aa1c7265909b23c39e4f1cc3edd4ba163dcce7ddd2c96b9224
|