Metadata-Version: 2.4
Name: eldercrank-stripe-flask
Version: 0.1.0b2
Summary: Flask integration for the eldercrank-stripe library, providing easy webhook handling for Stripe events in Flask applications.
Project-URL: Homepage, https://github.com/eldercrank/stripe-flask
Project-URL: Documentation, https://github.com/eldercrank/stripe-flask#readme
Project-URL: Repository, https://github.com/eldercrank/stripe-flask.git
Project-URL: Changelog, https://github.com/eldercrank/stripe-flask/releases
Project-URL: Issues, https://github.com/eldercrank/stripe-flask/issues
Author-email: Shawn <shawn@shawngrover.ca>
Maintainer-email: Shawn <shawn@shawngrover.ca>
License: MIT
License-File: LICENSE
Keywords: api-integration,flask,payment-processing,stripe,webhook
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: eldercrank-stripe-core
Requires-Dist: flask>=3.0.0
Description-Content-Type: text/markdown

# eldercrank-stripe-flask

Flask integration for the eldercrank-stripe library, providing easy webhook handling for Stripe events in Flask applications.

## Features

- **Simple Blueprint Creation**: One function call to create a webhook blueprint
- **Automatic Signature Verification**: Handled by the underlying StripeHandler
- **Customizable URL Prefix**: Configure your webhook endpoint prefix
- **Proper Error Handling**: Returns appropriate HTTP status codes for Stripe

## Installation

```bash
pip install eldercrank-stripe-flask
```

## Quick Start

```python
from flask import Flask
from eldercrank.stripe.core import StripeHandler
from eldercrank.stripe.flask import create_stripe_blueprint

# Create your Flask app
app = Flask(__name__)

# Create your Stripe handler
handler = StripeHandler(
    api_key="sk_test_...",
    webhook_secret="whsec_..."
)

# Register the Stripe webhook blueprint
app.register_blueprint(create_stripe_blueprint(handler))

# Register event handlers
def handle_payment_success(event_data):
    print(f"Payment successful!")

handler.add_event_handler("payment_intent.succeeded", handle_payment_success)
```

## Custom URL Prefix

```python
# Use a custom URL prefix
app.register_blueprint(
    create_stripe_blueprint(handler, url_prefix="/payments/stripe")
)
```

This will register the webhook endpoint at `/payments/stripe/webhook`.

## License

MIT
