Certainly! Here’s a more detailed description for your PyPI page:
---
# zibal_payment
`zibal_payment` is a comprehensive and secure Python package crafted specifically for integrating Zibal’s online payment gateway into Django applications. This package simplifies payment processing tasks, including creating payment requests, generating payment URLs, and verifying completed transactions with Zibal’s services.
   
## Key Features
- **Simple Integration**: Quickly integrate Zibal’s payment gateway into Django projects with minimal setup.
- **Full Payment Lifecycle Support**: Handle all steps of the payment process, from creating payment requests to verifying transactions.
- **Sandbox Mode**: Ideal for testing payment flows in a controlled environment without real transactions.
- **Secure and Reliable**: Built to ensure the security and integrity of transaction data.
## Installation
Install the package from PyPI:
```bash
pip install zibal-payment
```
## Getting Started
Below is a basic guide on using the package in Django projects.
### 1. Initializing the Client
By default, `ZibalDjangoClient` is the primary client for Django integrations. Just initialize it with your Zibal merchant ID.
```python
from zibal_payment.client import ZibalDjangoClient
# Initialize the ZibalDjangoClient for handling payment requests with default settings
client = ZibalDjangoClient()
```
### 2. Creating a Payment Request
Use the `payment_request` method to create a payment request. Specify essential details such as the amount, callback URL, and a description.
```python
try:
response = client.payment_request(
amount=1000, # Amount in Rials
callback_url="https://example.com/callback", # Callback URL for the response
description="Order #123"
)
track_id = response.get("trackId")
print(f"Payment request successful. Track ID: {track_id}")
except ZibalError as e:
print(f"Payment request error: {e}")
```
### 3. Generating a Payment URL
Once you have a `track_id`, generate a user-friendly URL to direct customers to the Zibal payment page.
```python
payment_url = client.generate_payment_url(track_id)
print(f"Payment URL: {payment_url}")
```
### 4. Verifying a Payment
After customers complete their payment, verify it using the `payment_verify` method to confirm the transaction's success.
```python
try:
verification_response = client.payment_verify(track_id=track_id)
print("Payment verification successful:", verification_response)
except ZibalError as e:
print(f"Verification error: {e}")
```
## API Reference
For a complete list of methods, parameters, and error handling strategies, see the full [API Reference](https://github.com/Mohammad222PR/zibal-payment/blob/main/docs/api_refrence).
## Contributions and Support
Contributions are welcome to further enhance this package’s functionality. For reporting issues or suggesting improvements, visit the [GitHub repository](https://github.com/Mohammad222PR/zibal_payment). Additionally, refer to the [Usage Guide](https://github.com/Mohammad222PR/zibal-payment/blob/main/docs/usage.md) for more in-depth instructions on integrating the package into your projects.
Raw data
{
"_id": null,
"home_page": "https://github.com/Mohammad222PR/zibal_payment",
"name": "django-zibal-payment",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "payment gateway django integration online payments",
"author": "Mohammad Eslami",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/f3/d5/94340c5efdeca952052f0806e2f8d3d7864d1ebe71452c051fe132790073/django_zibal_payment-1.0.1.tar.gz",
"platform": null,
"description": "Certainly! Here\u2019s a more detailed description for your PyPI page:\r\n\r\n---\r\n\r\n# zibal_payment\r\n\r\n`zibal_payment` is a comprehensive and secure Python package crafted specifically for integrating Zibal\u2019s online payment gateway into Django applications. This package simplifies payment processing tasks, including creating payment requests, generating payment URLs, and verifying completed transactions with Zibal\u2019s services.\r\n\r\n   \r\n\r\n## Key Features\r\n\r\n- **Simple Integration**: Quickly integrate Zibal\u2019s payment gateway into Django projects with minimal setup.\r\n- **Full Payment Lifecycle Support**: Handle all steps of the payment process, from creating payment requests to verifying transactions.\r\n- **Sandbox Mode**: Ideal for testing payment flows in a controlled environment without real transactions.\r\n- **Secure and Reliable**: Built to ensure the security and integrity of transaction data.\r\n\r\n## Installation\r\n\r\nInstall the package from PyPI:\r\n\r\n```bash\r\npip install zibal-payment\r\n```\r\n\r\n## Getting Started\r\n\r\nBelow is a basic guide on using the package in Django projects.\r\n\r\n### 1. Initializing the Client\r\n\r\nBy default, `ZibalDjangoClient` is the primary client for Django integrations. Just initialize it with your Zibal merchant ID.\r\n\r\n```python\r\nfrom zibal_payment.client import ZibalDjangoClient\r\n\r\n# Initialize the ZibalDjangoClient for handling payment requests with default settings\r\nclient = ZibalDjangoClient()\r\n\r\n```\r\n\r\n### 2. Creating a Payment Request\r\n\r\nUse the `payment_request` method to create a payment request. Specify essential details such as the amount, callback URL, and a description.\r\n\r\n```python\r\ntry:\r\n response = client.payment_request(\r\n amount=1000, # Amount in Rials\r\n callback_url=\"https://example.com/callback\", # Callback URL for the response\r\n description=\"Order #123\"\r\n )\r\n track_id = response.get(\"trackId\")\r\n print(f\"Payment request successful. Track ID: {track_id}\")\r\n\r\nexcept ZibalError as e:\r\n print(f\"Payment request error: {e}\")\r\n```\r\n\r\n### 3. Generating a Payment URL\r\n\r\nOnce you have a `track_id`, generate a user-friendly URL to direct customers to the Zibal payment page.\r\n\r\n```python\r\npayment_url = client.generate_payment_url(track_id)\r\nprint(f\"Payment URL: {payment_url}\")\r\n```\r\n\r\n### 4. Verifying a Payment\r\n\r\nAfter customers complete their payment, verify it using the `payment_verify` method to confirm the transaction's success.\r\n\r\n```python\r\ntry:\r\n verification_response = client.payment_verify(track_id=track_id)\r\n print(\"Payment verification successful:\", verification_response)\r\n\r\nexcept ZibalError as e:\r\n print(f\"Verification error: {e}\")\r\n```\r\n\r\n## API Reference\r\n\r\nFor a complete list of methods, parameters, and error handling strategies, see the full [API Reference](https://github.com/Mohammad222PR/zibal-payment/blob/main/docs/api_refrence).\r\n\r\n## Contributions and Support\r\n\r\nContributions are welcome to further enhance this package\u2019s functionality. For reporting issues or suggesting improvements, visit the [GitHub repository](https://github.com/Mohammad222PR/zibal_payment). Additionally, refer to the [Usage Guide](https://github.com/Mohammad222PR/zibal-payment/blob/main/docs/usage.md) for more in-depth instructions on integrating the package into your projects.\r\n\r\n\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple and secure Python package for integrating online payment processing in Django projects.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/Mohammad222PR/zibal_payment"
},
"split_keywords": [
"payment",
"gateway",
"django",
"integration",
"online",
"payments"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0a1aa1b19f8decbe80dfa0c6524b9497e071f1cf2a2ddfb0d4a305444a657082",
"md5": "99660d3736f0181b3661c0c6361e0af8",
"sha256": "0eecd8a5121522880f137b836b80b03808950ec7a63c20d53466ec6bb9498089"
},
"downloads": -1,
"filename": "django_zibal_payment-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "99660d3736f0181b3661c0c6361e0af8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7638,
"upload_time": "2024-10-25T07:14:30",
"upload_time_iso_8601": "2024-10-25T07:14:30.184170Z",
"url": "https://files.pythonhosted.org/packages/0a/1a/a1b19f8decbe80dfa0c6524b9497e071f1cf2a2ddfb0d4a305444a657082/django_zibal_payment-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f3d594340c5efdeca952052f0806e2f8d3d7864d1ebe71452c051fe132790073",
"md5": "d004b221e028ac812c115ea6d24e8624",
"sha256": "f23e6a1c67aa54a4a9d82d78e288af5f6bed5862c7f4f3618ecb2db21a6c1502"
},
"downloads": -1,
"filename": "django_zibal_payment-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "d004b221e028ac812c115ea6d24e8624",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7251,
"upload_time": "2024-10-25T07:14:31",
"upload_time_iso_8601": "2024-10-25T07:14:31.934315Z",
"url": "https://files.pythonhosted.org/packages/f3/d5/94340c5efdeca952052f0806e2f8d3d7864d1ebe71452c051fe132790073/django_zibal_payment-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 07:14:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Mohammad222PR",
"github_project": "zibal_payment",
"github_not_found": true,
"lcname": "django-zibal-payment"
}