Metadata-Version: 2.4
Name: fastapi-payments
Version: 0.1.0
Summary: A flexible and extensible payment library for FastAPI
Author-email: InnerKore <gagan@innerkore.com>
License: MIT
Project-URL: Homepage, https://github.com/innerkorehq/fastapi-payments
Project-URL: Bug Tracker, https://github.com/innerkorehq/fastapi-payments/issues
Project-URL: Documentation, https://fastapi-payments.readthedocs.io/
Keywords: fastapi,payments,stripe,paypal,adyen,rabbitmq
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.103.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: asyncpg>=0.27.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: faststream[redis]>=0.2.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: email-validator>=2.0.0
Provides-Extra: stripe
Requires-Dist: stripe>=6.0.0; extra == "stripe"
Provides-Extra: paypal
Requires-Dist: paypalrestsdk>=1.13.1; extra == "paypal"
Provides-Extra: adyen
Requires-Dist: Adyen>=13.0.0; extra == "adyen"
Provides-Extra: rabbitmq
Requires-Dist: faststream[rabbit]>=0.2.0; extra == "rabbitmq"
Provides-Extra: kafka
Requires-Dist: faststream[kafka]>=0.2.0; extra == "kafka"
Provides-Extra: nats
Requires-Dist: faststream[nats]>=0.2.0; extra == "nats"
Provides-Extra: all
Requires-Dist: stripe>=6.0.0; extra == "all"
Requires-Dist: paypalrestsdk>=1.13.1; extra == "all"
Requires-Dist: Adyen>=13.0.0; extra == "all"
Requires-Dist: faststream[kafka,nats,rabbit,redis]>=0.2.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: faststream[memory,rabbit]>=0.2.0; extra == "dev"

# FastAPI Payments Library

A flexible and extensible payment library for FastAPI applications supporting multiple payment providers and pricing models.

## Features

- **Multiple Payment Providers**: Support for Stripe, PayPal, Adyen, and more
- **Flexible Pricing Models**: 
  - Subscription
  - Usage-based
  - Tiered pricing
  - Per-user/seat pricing
  - Freemium
  - Dynamic pricing
  - Hybrid models
- **Asynchronous Architecture**: Built on FastAPI and SQLAlchemy 2.0 with async support
- **Event-Driven**: RabbitMQ integration via FastStream for reliable payment event messaging
- **Highly Configurable**: Extensive configuration options to customize for your needs
- **Extensible**: Easy to add new payment providers or custom pricing models

## Installation

```bash
pip install fastapi-payments
```

## Quick Start

```python
from fastapi import FastAPI
from fastapi_payments import FastAPIPayments, create_payment_module
import json

# Create FastAPI app
app = FastAPI()

# Load payment configuration
with open("config/payment_config.json") as f:
    config = json.load(f)

# Initialize payments module
payments = FastAPIPayments(config)

# Include payment routes
payments.include_router(app, prefix="/api")

# Start server
if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)
```

## Configuration

Create a `payment_config.json` file:

```json
{
  "providers": {
    "stripe": {
      "api_key": "sk_test_your_stripe_key",
      "webhook_secret": "whsec_your_webhook_secret",
      "sandbox_mode": true
    }
  },
  "database": {
    "url": "postgresql+asyncpg://user:password@localhost/payments"
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost/"
  },
  "pricing": {
    "default_currency": "USD",
    "default_pricing_model": "subscription"
  },
  "default_provider": "stripe"
}
```

## Documentation

For complete documentation, visit [https://fastapi-payments.readthedocs.io/](https://fastapi-payments.readthedocs.io/)

## License

MIT
