Metadata-Version: 2.4
Name: zivonpay
Version: 1.0.0
Summary: Official Python SDK for ZivonPay Payment Aggregator — UPI payments, orders, refunds, webhooks
Author-email: ZivonPay <support@zivonpay.com>
License-Expression: MIT
Project-URL: Homepage, https://zivonpay.com
Project-URL: Documentation, https://zivonpay.com/developer-docs
Project-URL: Repository, https://github.com/soorajpandya/zivonpay
Project-URL: Bug Tracker, https://github.com/soorajpandya/zivonpay/issues
Keywords: zivonpay,payment,upi,sdk,payment-gateway,india,fintech
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# ZivonPay Python SDK

Official Python SDK for ZivonPay Payment Aggregator.

## Installation

```bash
pip install zivonpay
```

## Usage

```python
from zivonpay import ZivonPay

# Initialize client
client = ZivonPay(
    key_id='zp_test_xxxxx',
    key_secret='your_secret_key',
    environment='sandbox'  # or 'production'
)

# Create order
order = client.create_order(
    amount=1000,  # Amount in paise
    receipt='order_123',
    customer={
        'name': 'Rahul Sharma',
        'mobile': '8877664543'
    },
    notes={
        'description': 'Payment for order'
    }
)

print('UPI Intent URL:', order['upi_intent_url'])

# Fetch order
order = client.fetch_order(order['id'])

# List orders
orders = client.list_orders(skip=0, limit=10)
```

## Webhook Verification

```python
from flask import Flask, request
from zivonpay import ZivonPay

app = Flask(__name__)

@app.route('/webhooks/zivonpay', methods=['POST'])
def webhook():
    payload = request.get_data(as_text=True)
    signature = request.headers.get('X-ZivonPay-Signature')
    timestamp = int(request.headers.get('X-ZivonPay-Timestamp'))
    
    is_valid = ZivonPay.verify_webhook_signature(
        payload=payload,
        signature=signature,
        timestamp=timestamp,
        secret='your_webhook_secret'
    )
    
    if is_valid:
        event = request.get_json()
        print('Webhook event:', event)
        return '', 200
    else:
        return 'Invalid signature', 400
```

## API Reference

See [documentation](https://docs.zivonpay.com) for complete API reference.

## License

MIT
