Skip to main content

Flaxon Stripe

flaxon-stripe exposes a configured Stripe SDK client at app.state.stripe. It also provides a safe webhook signature-verification helper. It does not create payment routes automatically: applications should define their own authorization and business rules.

Install

pip install flaxon-stripe

Use

import os

from flaxon import Flaxon
from flaxon_stripe import StripePlugin

app = Flaxon("billing")
await app.plugins.load_plugin(
    StripePlugin(
        api_key=os.environ["STRIPE_SECRET_KEY"],
        webhook_secret=os.environ["STRIPE_WEBHOOK_SECRET"],
    )
)


@app.post("/stripe/webhook")
async def stripe_webhook(request):
    event = app.state.stripe.verify_webhook(
        await request.body(),
        request.headers["stripe-signature"],
    )
    return {"received": event["id"]}

Use Stripe's official API version configuration, keep both secrets out of source control, and make webhook processing idempotent. A successful HTTP response must only be sent after the event has been durably recorded or safely queued.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flaxon_stripe-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flaxon_stripe-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file flaxon_stripe-0.1.0.tar.gz.

File metadata

  • Download URL: flaxon_stripe-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for flaxon_stripe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b3d5b25f8ac57d19775dc9407b27f3ca7b25bf1cec7c5a2249ceffbafa005c81
MD5 f8e875caa81413b3e35b5f82da3efea3
BLAKE2b-256 6c4f96ea4fbe37f34ec187a2fa9a2c01b2f21d65b92529c6299079fb83a7a5b2

See more details on using hashes here.

File details

Details for the file flaxon_stripe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flaxon_stripe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for flaxon_stripe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 624d140af425f2c70fa5695f293ffd0bd3e47bcae530354934ffea6eb1a04c7b
MD5 5f96c61ff7917bbd727604c4f8aabb61
BLAKE2b-256 4f9fd6ec6a6163ea663aa08a0ea966531c9b663c0ae6f394156ac134c163d070

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page