<h1 align="center">Click Software Development Kit</h1>
<p align="center">
<a href="https://t.me/+lO97J78xBj45MzBi">
<img src="https://img.shields.io/badge/Support%20Group-blue?logo=telegram&logoColor=white" alt="Support Group on Telegram"/>
</a>
</p>
## Installation
```shell
pip install click-pkg
```
## Installation to Django
Add `'click_up'` in to your settings.py
```python
INSTALLED_APPS = [
...
'click_up',
...
]
```
Add `'click_up'` credentials inside to settings.py
Click configuration settings.py
```python
CLICK_SERVICE_ID = "your-service-id"
CLICK_MERCHANT_ID = "your-merchant-id"
CLICK_SECRET_KEY = "your-secret-key"
CLICK_ACCOUNT_MODEL = "order.models.Order" # your order model path.
CLICK_AMOUNT_FIELD = "amount" # your amount field that's belongs to your order model
```
Create a new View that about handling call backs
```python
from click_up.views import ClickWebhook
class ClickWebhookAPIView(ClickWebhook):
def successfully_payment(self, params):
"""
successfully payment method process you can ovveride it
"""
print(f"payment successful params: {params}")
def cancelled_payment(self, params):
"""
cancelled payment method process you can ovveride it
"""
print(f"payment cancelled params: {params}")
```
Add a `payme` path to core of urlpatterns:
```python
from django.urls import path
from django.urls import include
from your_app.views import ClickWebhookAPIView
urlpatterns = [
...
path("payment/click/update/", ClickWebhookAPIView.as_view()),
...
]
```
Run migrations
```shell
python3 manage.py makemigrations && python manage.py migrate
```
🎉 Congratulations you have been integrated click with django, keep reading docs. After successfull migrations check your admin panel and see results what happened.
## Generate Pay Link
Example to generate link:
- Input
```python
from click_up import ClickUp
click_up = ClickUp(service_id="your-service-id", merchant_id="your-merchant-id") # alternatively you can use settings variables as well here.
# Generate Paylik payment link
paylink = click_up.initializer.generate_pay_link(
id=1, # id maybe order_id or acount_id (user_id, chat_id and etc..)
amount=100,
return_url="https://example.com"
)
```
- Output
```
https://my.click.uz/services/pay?service_id=service_id&merchant_id=merchant_id&amount=1000&transaction_param=1&return_url=https://example.com
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Muhammadali-Akbarov/click-pkg",
"name": "click-pkg",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "click-shop-api, click, click-merchant, click-pkg, click-api, click-python-integration, click-integration, click-python, click-gateway, click-payment, click-payment-gateway, click-integration-python, click-api-client, click-django, click-rest-api",
"author": "Muhammadali Akbarov",
"author_email": "muhammadali17abc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d9/54/017a4e1a1825bfbe89758f8344c386cf81374a38c27ee85c458827dac998/click_pkg-0.7.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">Click Software Development Kit</h1>\n\n<p align=\"center\">\n <a href=\"https://t.me/+lO97J78xBj45MzBi\">\n <img src=\"https://img.shields.io/badge/Support%20Group-blue?logo=telegram&logoColor=white\" alt=\"Support Group on Telegram\"/>\n </a>\n</p>\n\n\n## Installation\n\n```shell\npip install click-pkg\n```\n\n## Installation to Django\n\nAdd `'click_up'` in to your settings.py\n\n```python\nINSTALLED_APPS = [\n ...\n 'click_up',\n ...\n]\n```\n\nAdd `'click_up'` credentials inside to settings.py\n\nClick configuration settings.py\n```python\nCLICK_SERVICE_ID = \"your-service-id\"\nCLICK_MERCHANT_ID = \"your-merchant-id\"\nCLICK_SECRET_KEY = \"your-secret-key\"\nCLICK_ACCOUNT_MODEL = \"order.models.Order\" # your order model path.\nCLICK_AMOUNT_FIELD = \"amount\" # your amount field that's belongs to your order model\n```\n\nCreate a new View that about handling call backs\n```python\nfrom click_up.views import ClickWebhook\n\n\nclass ClickWebhookAPIView(ClickWebhook):\n def successfully_payment(self, params):\n \"\"\"\n successfully payment method process you can ovveride it\n \"\"\"\n print(f\"payment successful params: {params}\")\n\n def cancelled_payment(self, params):\n \"\"\"\n cancelled payment method process you can ovveride it\n \"\"\"\n print(f\"payment cancelled params: {params}\")\n```\n\nAdd a `payme` path to core of urlpatterns:\n\n```python\nfrom django.urls import path\nfrom django.urls import include\n\nfrom your_app.views import ClickWebhookAPIView\n\n\nurlpatterns = [\n ...\n path(\"payment/click/update/\", ClickWebhookAPIView.as_view()),\n ...\n]\n```\n\nRun migrations\n```shell\npython3 manage.py makemigrations && python manage.py migrate\n```\n\n\ud83c\udf89 Congratulations you have been integrated click with django, keep reading docs. After successfull migrations check your admin panel and see results what happened.\n\n\n## Generate Pay Link\nExample to generate link:\n\n- Input\n\n```python\nfrom click_up import ClickUp\n\n\nclick_up = ClickUp(service_id=\"your-service-id\", merchant_id=\"your-merchant-id\") # alternatively you can use settings variables as well here.\n\n\n# Generate Paylik payment link\npaylink = click_up.initializer.generate_pay_link(\n id=1, # id maybe order_id or acount_id (user_id, chat_id and etc..)\n amount=100,\n return_url=\"https://example.com\"\n)\n```\n\n- Output\n```\nhttps://my.click.uz/services/pay?service_id=service_id&merchant_id=merchant_id&amount=1000&transaction_param=1&return_url=https://example.com\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": null,
"version": "0.7",
"project_urls": {
"Homepage": "https://github.com/Muhammadali-Akbarov/click-pkg"
},
"split_keywords": [
"click-shop-api",
" click",
" click-merchant",
" click-pkg",
" click-api",
" click-python-integration",
" click-integration",
" click-python",
" click-gateway",
" click-payment",
" click-payment-gateway",
" click-integration-python",
" click-api-client",
" click-django",
" click-rest-api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d954017a4e1a1825bfbe89758f8344c386cf81374a38c27ee85c458827dac998",
"md5": "1ce3dc57301c90809a1036ce3503ac90",
"sha256": "cdfda2f7abfa27beab26f11c6342b3ffc461a4f00885825cd034bcb64e72736f"
},
"downloads": -1,
"filename": "click_pkg-0.7.tar.gz",
"has_sig": false,
"md5_digest": "1ce3dc57301c90809a1036ce3503ac90",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9244,
"upload_time": "2024-12-16T06:39:20",
"upload_time_iso_8601": "2024-12-16T06:39:20.631019Z",
"url": "https://files.pythonhosted.org/packages/d9/54/017a4e1a1825bfbe89758f8344c386cf81374a38c27ee85c458827dac998/click_pkg-0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 06:39:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Muhammadali-Akbarov",
"github_project": "click-pkg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "click-pkg"
}