Metadata-Version: 2.4
Name: remino-zarinpal-py-sdk
Version: 1.0.3
Summary: A Python SDK for Remino Zarinpal Payment Gateway
Home-page: https://github.com/reminerdino/remino-zarinpal-py-sdk
Author: Iman Ashoori
Author-email: imanashoorii.77@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anyio==4.7.0
Requires-Dist: attrs==24.2.0
Requires-Dist: certifi==2024.8.30
Requires-Dist: cffi==1.17.1
Requires-Dist: charset-normalizer==3.3.2
Requires-Dist: chromedriver-autoinstaller==0.6.4
Requires-Dist: colorama==0.4.6
Requires-Dist: crypto==1.4.1
Requires-Dist: cryptography==43.0.1
Requires-Dist: dnspython==2.7.0
Requires-Dist: docutils==0.21.2
Requires-Dist: email_validator==2.2.0
Requires-Dist: h11==0.14.0
Requires-Dist: httpcore==1.0.7
Requires-Dist: httpx==0.28.1
Requires-Dist: idna==3.10
Requires-Dist: iniconfig==2.0.0
Requires-Dist: jaraco.classes==3.4.0
Requires-Dist: jaraco.context==6.0.1
Requires-Dist: jaraco.functools==4.1.0
Requires-Dist: jsonschema==4.23.0
Requires-Dist: jsonschema-specifications==2024.10.1
Requires-Dist: keyring==25.6.0
Requires-Dist: markdown-it-py==3.0.0
Requires-Dist: mdurl==0.1.2
Requires-Dist: more-itertools==10.5.0
Requires-Dist: Naked==0.1.32
Requires-Dist: nh3==0.2.20
Requires-Dist: outcome==1.3.0.post0
Requires-Dist: packaging==24.2
Requires-Dist: pkginfo==1.12.0
Requires-Dist: pluggy==1.5.0
Requires-Dist: psutil==6.1.0
Requires-Dist: pycparser==2.22
Requires-Dist: pycryptodome==3.21.0
Requires-Dist: Pygments==2.19.1
Requires-Dist: pyotp==2.9.0
Requires-Dist: pyperclip==1.9.0
Requires-Dist: PySocks==1.7.1
Requires-Dist: pytest==8.3.4
Requires-Dist: pytest-order==1.3.0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: PyYAML==6.0.2
Requires-Dist: readme_renderer==44.0
Requires-Dist: referencing==0.35.1
Requires-Dist: requests==2.32.3
Requires-Dist: requests-mock==1.12.1
Requires-Dist: requests-pkcs12==1.25
Requires-Dist: requests-toolbelt==1.0.0
Requires-Dist: responses==0.25.3
Requires-Dist: rfc3986==2.0.0
Requires-Dist: rich==13.9.4
Requires-Dist: rpds-py==0.20.0
Requires-Dist: selenium==4.27.1
Requires-Dist: setuptools==75.8.0
Requires-Dist: shellescape==3.8.1
Requires-Dist: sniffio==1.3.1
Requires-Dist: sortedcontainers==2.4.0
Requires-Dist: trio==0.27.0
Requires-Dist: trio-websocket==0.11.1
Requires-Dist: twine==6.0.1
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: urllib3==2.2.3
Requires-Dist: webdriver-manager==4.0.2
Requires-Dist: websocket-client==1.8.0
Requires-Dist: wheel==0.45.1
Requires-Dist: wsproto==1.2.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Zarinpal Python SDK Documentation

## **Introduction**

The **Zarinpal Python SDK** provides an easy and flexible way to interact with Zarinpal’s payment gateway APIs. With features like payment initiation, transaction management, refunds, and reversals, it helps streamline integration with Zarinpal’s platform in both live and sandbox environments.

---

## **Installation**

### **Requirements**:  
- Python >= 3.12

### **Install**:

**From PyPI**:
```bash
pip install zarinpal-py-sdk
```

**From TestPyPI (for testing purposes)**:
```bash
pip install -i https://test.pypi.org/simple/ zarinpal-py-sdk
```

### **Features**:

1. **Manage Payments**:

    Easily initiate and verify payments using secure APIs.

    Example:
    ```python
    payment = zarinpal.payment_gateway.create({  
        "amount": 10000,  
        "description": "Order #1234",  
        "callback_url": "https://example.com/callback",  
    })
    ```

2. **Transaction Management**:

    Fetch transaction details with filters, limits, and pagination using GraphQL.

    Example:
    ```python
    transactions = zarinpal.transactions.list({  
        "terminal_id": "YourTerminalID",  
        "filter": "PAID",  
        "limit": 10,  
        "offset": 0,  
    })
    ```

3. **Refunds & Reversals**:

    Easily process refunds or reverse a transaction with a single API call.

    Example - Refund:
    ```python
    refund = zarinpal.refunds.create({  
        "session_id": "Session1234",  
        "amount": 5000,  
        "description": "Refund for Order #1234",  
        "reason": "CUSTOMER_REQUEST",  
    })

    Example - Reversal:

    response = zarinpal.reversals.reverse({  
        "authority": "AUTHORITY_CODE",  
    })
    ```

4. **Sandbox Support**:

    Easily switch between sandbox and live environments for development and production.

## **How to Use**:

5. **Initialize SDK**:

```bash
from zarinpal import ZarinPal  
from tools.Config import Config  

config = Config(  
    access_token="YourAccessToken",  
    merchant_id="YourMerchantId"
    sandbox=True,  # Use sandbox environment  
)  
zarinpal = ZarinPal(config)  

Full Example: Fetching Transactions

from zarinpal import ZarinPal  
from tools.Config import Config  

def get_transactions():  
    try:  
        config = Config(  
            access_token="YourAccessToken",  
        )  
        zarinpal = ZarinPal(config)  

        transactions = zarinpal.transactions.list({  
            "terminal_id": "YourTerminalID",  
            "filter": "PAID",  
            "limit": 10,  
            "offset": 0,  
        })  

        print("Transactions List:", transactions)  
    except Exception as e:  
        print("Error fetching transactions:", e)  

if __name__ == "__main__":  
    get_transactions()
```
### **Contribute**:

Contributions are welcome! Fork the repository, make your changes, and submit a pull request.

GitHub Repository: [Zarinpal Python SDK](https://github.com/ImanAttary/zarinpal_py_sdk)

By simplifying integration, this SDK ensures smooth payment workflows, enabling developers to focus on building excellent user experiences.
