Skip to main content

Working library with Zarin Pal payment gateway services

Project description

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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarinpalapi-0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zarinpalapi-0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file zarinpalapi-0.1.tar.gz.

File metadata

  • Download URL: zarinpalapi-0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for zarinpalapi-0.1.tar.gz
Algorithm Hash digest
SHA256 f34a90dd48de98f9a4ede5d19928b96beb023912cb74a988127cc6a5d1707506
MD5 73058768655d396d417d2289abf1e535
BLAKE2b-256 5aff468946148a516a46b880ad6ec792d2031ffbf7de8d48646a9c8ce0477d08

See more details on using hashes here.

File details

Details for the file zarinpalapi-0.1-py3-none-any.whl.

File metadata

  • Download URL: zarinpalapi-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for zarinpalapi-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03290b2f18ec0747370c6f60dc8f2f71728f84b1ec8c59e3e054aa8b0bc20ec6
MD5 c16647d694dc45c414c52d3de4ddd642
BLAKE2b-256 88e2f98230012f6451d1c1678d091aeba28c010b5565b8c18b275b1fe4b18db5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page