Metadata-Version: 2.4
Name: eldercrank-stripe-fastapi
Version: 0.1.0b2
Summary: FastAPI integration for the eldercrank-stripe library, providing easy webhook handling for Stripe events in FastAPI applications.
Project-URL: Homepage, https://github.com/eldercrank/stripe-fastapi
Project-URL: Documentation, https://github.com/eldercrank/stripe-fastapi#readme
Project-URL: Repository, https://github.com/eldercrank/stripe-fastapi.git
Project-URL: Changelog, https://github.com/eldercrank/stripe-fastapi/releases
Project-URL: Issues, https://github.com/eldercrank/stripe-fastapi/issues
Author-email: Shawn <shawn@shawngrover.ca>
Maintainer-email: Shawn <shawn@shawngrover.ca>
License: MIT
License-File: LICENSE
Keywords: api-integration,fastapi,payment-processing,stripe,webhook
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: FastAPI
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: fastapi>=0.128.0
Description-Content-Type: text/markdown

# eldercrank-stripe-fastapi

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

## Features

- **Simple Router Creation**: One function call to create a webhook router
- **Automatic Signature Verification**: Handled by the underlying StripeHandler
- **Customizable Path**: Configure your webhook endpoint path
- **Proper Error Handling**: Returns appropriate HTTP status codes for Stripe

## Installation

```bash
pip install eldercrank-stripe-fastapi
```

## Quick Start

```python
from fastapi import FastAPI
from eldercrank.stripe.core import StripeHandler
from eldercrank.stripe.fastapi import create_stripe_router

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

# Create your FastAPI app
app = FastAPI()

# Include the Stripe webhook router
app.include_router(create_stripe_router(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 Webhook Path

```python
# Use a custom webhook path
app.include_router(
    create_stripe_router(handler, webhook_path="/stripe/webhook")
)
```

## License

MIT
