Metadata-Version: 2.4
Name: sardis-cards
Version: 1.1.0
Summary: Virtual card integration for Sardis payment platform
Project-URL: Homepage, https://sardis.sh
Project-URL: Documentation, https://sardis.sh/docs
Project-URL: Repository, https://github.com/EfeDurmaz16/sardis
Project-URL: Changelog, https://github.com/EfeDurmaz16/sardis/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/EfeDurmaz16/sardis/issues
Author-email: Sardis Team <dev@sardis.sh>
Maintainer-email: Sardis Team <dev@sardis.sh>
License: MIT
License-File: LICENSE
Keywords: ai-agents,fintech,lithic,mastercard,payments,sardis,virtual-cards,visa
Classifier: Development Status :: 4 - Beta
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: sardis-core
Requires-Dist: stripe>=7.0.0
Provides-Extra: all
Requires-Dist: lithic>=0.30.0; extra == 'all'
Requires-Dist: stripe>=7.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Provides-Extra: lithic
Requires-Dist: lithic>=0.30.0; extra == 'lithic'
Provides-Extra: stripe
Requires-Dist: stripe>=7.0.0; extra == 'stripe'
Description-Content-Type: text/markdown

# sardis-cards

Virtual card integration for Sardis payment platform.

## Overview

This package provides virtual card issuance and management capabilities for AI agent wallets. It supports multiple card providers with Lithic as the primary integration.

## Supported Providers

- **Lithic** (recommended) - Developer-friendly API, used by Mercury, Brex, Ramp
- **Mock** - For testing and development

## Features

- Issue virtual cards linked to agent wallets
- Pre-load cards from stablecoin balances or bank transfers
- Per-transaction, daily, and monthly spending limits
- Merchant category controls
- Real-time transaction webhooks
- Card freeze/unfreeze operations

## Installation

```bash
pip install sardis-cards

# With Lithic provider
pip install sardis-cards[lithic]
```

## Quick Start

```python
from sardis_cards import CardService
from sardis_cards.providers.lithic import LithicProvider

# Initialize provider
provider = LithicProvider(api_key="your_lithic_api_key")
service = CardService(provider=provider)

# Issue a virtual card
card = await service.issue_card(
    wallet_id="wallet_123",
    card_type="virtual",
    limit_per_tx=500.00,
    limit_daily=2000.00,
)

# Fund the card
await service.fund_card(
    card_id=card.card_id,
    amount=100.00,
    source="stablecoin",
)

# Get card details
card = await service.get_card(card_id=card.card_id)
```

## Webhooks

Handle card transaction webhooks:

```python
from sardis_cards.webhooks import CardWebhookHandler

handler = CardWebhookHandler(secret="your_webhook_secret")

@app.post("/webhooks/cards")
async def handle_card_webhook(request: Request):
    event = handler.verify_and_parse(
        payload=await request.body(),
        signature=request.headers.get("X-Lithic-Signature"),
    )
    
    if event.type == "transaction.created":
        # Handle new transaction
        pass
```

## Configuration

Set environment variables:

```bash
LITHIC_API_KEY=your_api_key
LITHIC_ENVIRONMENT=sandbox  # or production
LITHIC_WEBHOOK_SECRET=your_webhook_secret
```

## License

MIT
