Stripe billing plugin for Belgie
Project description
Belgie Stripe: Billing and Subscription Management
Belgie Stripe adds Stripe customer creation, Checkout-based subscription acquisition, Customer Portal management, and webhook-driven subscription syncing to Belgie.
The package follows Belgie's plugin model:
- register
Stripe(...)withauth.add_plugin(...) - mount package-owned routes under
/auth - optionally inject
StripeClientinto your own routes - compose explicit SQLAlchemy mixins instead of dynamic schema mapping
Installation
uv add belgie-stripe belgie-organization
For the umbrella package:
uv add belgie[alchemy,stripe,organization]
What It Provides
Stripesettings for Stripe billing configurationStripePluginfor route mounting and dependency injectionStripeClientfor app-owned billing flowsStripePlanand request/response modelsStripeAdapterand SQLAlchemy mixins for subscription persistence
Configuration
import stripe
from belgie_stripe import Stripe, StripePlan, StripeSubscription
stripe_client = stripe.StripeClient(
"sk_test_...",
http_client=stripe.HTTPXClient(),
)
plugin = Stripe(
stripe=stripe_client,
stripe_webhook_secret="whsec_...",
subscription=StripeSubscription(
adapter=subscription_adapter,
plans=[StripePlan(name="pro", price_id="price_pro", annual_price_id="price_pro_year")],
),
)
StripePlan.proration_behavior and the request locale fields use Stripe 15 generated SDK types. Belgie Stripe is
intentionally pinned to the Stripe 15 surface rather than carrying compatibility branches for newer major versions.
Route Surface
Mounted under /auth:
POST /stripe/webhookPOST /subscription/upgradeGET /subscription/listPOST /subscription/cancelPOST /subscription/restorePOST /subscription/billing-portalGET /subscription/success
Data Model
To use belgie-stripe with belgie-alchemy, compose these mixins into your models:
StripeAccountMixinStripeSubscriptionMixin
Belgie does not do schema remapping at runtime. The Stripe columns and table are explicit model definitions that live in your application code.
Notes
- Billing flows target a generic
Account, so individuals, organizations, and teams all useaccount_id. - Stripe customer creation supports both lazy creation on first billing action and automatic creation during
client.sign_up()whencreate_account_on_sign_up=True. - Individual email changes are synced back to Stripe as a best-effort hook when updates go through
BelgieClient.update_individual(...). Belgie-owned OAuth and SSO profile refresh flows already use that path. - Direct adapter calls such as
adapter.update_individual(...)bypass plugin hooks by design. - Injected
StripeClientinstances expose the raw async Stripe SDK asclient.stripefor app-owned SDK calls. - The package is designed around Stripe Billing APIs, Checkout Sessions, and Customer Portal.
- Stripe support is limited to
>=15,<16.
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 belgie_stripe-0.19.0.tar.gz.
File metadata
- Download URL: belgie_stripe-0.19.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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 |
88d0a140b7ee2ed6f82f5b20feffad2369aeed84c1fdf2f4d5ef06bfed5f6b81
|
|
| MD5 |
d726582c41ae436a2d503aae9caca027
|
|
| BLAKE2b-256 |
75cc0c761a9bcadda65966fee09051cbc3b57b3ce671e5a168be66957d5e6a4c
|
File details
Details for the file belgie_stripe-0.19.0-py3-none-any.whl.
File metadata
- Download URL: belgie_stripe-0.19.0-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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 |
7b12e8cc10ea40e0c9c5ad1d024e13f285843ab9d59f2243c67768315e5dd907
|
|
| MD5 |
9a8be065ebf7b1ed35f7888e0bfed712
|
|
| BLAKE2b-256 |
61dc403b1a05d61edb47413d30c386c0f531f06359981894d5a24946c02d1fac
|