Metadata-Version: 2.1
Name: zarinpalapi
Version: 0.1
Summary: Working library with Zarin Pal payment gateway services
Home-page: https://github.com/Mahditerorist/
Author: Mahdi Ahmadi
Author-email: mahdiahmadi.1208@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: urllib3

Python Payment Gateway Library
Overview
This library provides an easy-to-use interface for integrating online payment gateways into your Python projects. It supports essential features such as generating payment URLs, verifying payments, and querying transaction statuses.

The library is written using asynchronous Python (async/await), ensuring high performance for applications handling multiple payment operations.

Features
Generate secure payment links for supported gateways.
Verify payments with transaction details.
Query transaction status for historical records.
Supports popular payment gateways (e.g., Zarinpal, NextPay, etc.).
Lightweight and easy to integrate.
Installation
You can install the library via pip (once published to PyPI):

bash
Copy
Edit
pip install my_payment_gateway
For development purposes, you can clone this repository and install locally:

bash
Copy
Edit
git clone https://github.com/yourusername/my_payment_gateway.git
cd my_payment_gateway
pip install -e .
Usage Example
Here’s a quick example to generate a payment link and verify the payment:

python
Copy
Edit
import asyncio
from my_payment_gateway import PaymentGateway

async def main():
    # Initialize the gateway
    gateway = PaymentGateway(api_key="your_api_key", callback_url="https://yourcallback.url")

    # Generate a payment link
    payment_url = await gateway.create_payment(amount=100000, description="Test payment")
    print(f"Payment URL: {payment_url}")

    # Verify a transaction
    is_verified, details = await gateway.verify_payment(transaction_id="123456789")
    if is_verified:
        print("Payment verified:", details)
    else:
        print("Payment verification failed:", details)

asyncio.run(main())
Supported Gateways
The library currently supports the following payment gateways:

Zarinpal
NextPay
[Add more as needed]
Configuration
You can configure the library with the following parameters:

Parameter	Description
api_key	Your gateway API key (required).
callback_url	The URL to redirect users post-payment.
sandbox	Use the sandbox mode for testing (default: False).
Contributing
Contributions are welcome! If you’d like to contribute, please:

Fork the repository.
Create a new branch for your feature or bug fix.
Submit a pull request with a clear description of your changes.
License
This library is distributed under the MIT License. See the LICENSE file for more information.

Support
If you encounter any issues or have questions, feel free to create an issue in the GitHub repository.

