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.
Metadata
Release files for zarinpalapi 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zarinpalapi-0.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zarinpalapi-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.4 kB
Release files / zarinpalapi-0.1.tar.gz
| Download URL | zarinpalapi-0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f34a90dd48de98f9a4ede5d19928b96beb023912cb74a988127cc6a5d1707506
|
|
BLAKE2b-256 checksum How to use checksums |
5aff468946148a516a46b880ad6ec792d2031ffbf7de8d48646a9c8ce0477d08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|
Release files / zarinpalapi-0.1-py3-none-any.whl
| Download URL | zarinpalapi-0.1-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03290b2f18ec0747370c6f60dc8f2f71728f84b1ec8c59e3e054aa8b0bc20ec6
|
|
BLAKE2b-256 checksum How to use checksums |
88e2f98230012f6451d1c1678d091aeba28c010b5565b8c18b275b1fe4b18db5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.4
|