paytechuz 0.2.17__tar.gz → 0.2.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of paytechuz might be problematic. Click here for more details.
- {paytechuz-0.2.17 → paytechuz-0.2.19}/PKG-INFO +1 -2
- {paytechuz-0.2.17 → paytechuz-0.2.19}/README.md +0 -1
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/main.py +1 -1
- {paytechuz-0.2.17 → paytechuz-0.2.19}/pyproject.toml +1 -1
- {paytechuz-0.2.17 → paytechuz-0.2.19}/setup.py +1 -1
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/fastapi/routes.py +35 -25
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/__init__.py +1 -1
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz.egg-info/PKG-INFO +1 -2
- {paytechuz-0.2.17 → paytechuz-0.2.19}/MANIFEST.in +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/app/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/app/database.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/app/models.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/app/typing.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/app/webhook_handlers.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/payments.db +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/examples/paytechuz_fastapi/run.sh +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/setup.cfg +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/base.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/constants.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/exceptions.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/http.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/payme/errors.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/core/utils.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/click/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/click/client.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/click/merchant.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/click/webhook.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/payme/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/payme/cards.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/payme/client.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/payme/receipts.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/gateways/payme/webhook.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/admin.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/apps.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/migrations/0001_initial.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/migrations/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/models.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/signals.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/views.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/django/webhooks.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/fastapi/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/fastapi/models.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/integrations/fastapi/schemas.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/base.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/constants.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/exceptions.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/http.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/payme/errors.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/core/utils.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/click/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/click/client.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/click/merchant.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/click/webhook.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/payme/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/payme/cards.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/payme/client.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/payme/receipts.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/gateways/payme/webhook.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/admin.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/apps.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/migrations/0001_initial.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/migrations/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/models.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/signals.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/views.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/webhooks.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/fastapi/__init__.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/fastapi/models.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/fastapi/routes.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/fastapi/schemas.py +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz.egg-info/SOURCES.txt +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz.egg-info/dependency_links.txt +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz.egg-info/top_level.txt +0 -0
- {paytechuz-0.2.17 → paytechuz-0.2.19}/tests/test_click_gateway.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: paytechuz
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.19
|
|
4
4
|
Summary: Unified Python package for Uzbekistan payment gateways
|
|
5
5
|
Home-page: https://github.com/Muhammadali-Akbarov/paytechuz
|
|
6
6
|
Author: Muhammadali Akbarov
|
|
@@ -298,7 +298,6 @@ async def click_webhook(request: Request, db: Session = Depends(get_db)):
|
|
|
298
298
|
handler = CustomClickWebhookHandler(
|
|
299
299
|
db=db,
|
|
300
300
|
service_id="your_service_id",
|
|
301
|
-
merchant_id="your_merchant_id",
|
|
302
301
|
secret_key="your_secret_key",
|
|
303
302
|
account_model=Order
|
|
304
303
|
)
|
|
@@ -283,7 +283,6 @@ async def click_webhook(request: Request, db: Session = Depends(get_db)):
|
|
|
283
283
|
handler = CustomClickWebhookHandler(
|
|
284
284
|
db=db,
|
|
285
285
|
service_id="your_service_id",
|
|
286
|
-
merchant_id="your_merchant_id",
|
|
287
286
|
secret_key="your_secret_key",
|
|
288
287
|
account_model=Order
|
|
289
288
|
)
|
|
@@ -91,12 +91,12 @@ async def payme_webhook(request: Request, db: Session = Depends(get_db)):
|
|
|
91
91
|
)
|
|
92
92
|
return await handler.handle_webhook(request)
|
|
93
93
|
|
|
94
|
+
|
|
94
95
|
@app.post("/payments/click/webhook")
|
|
95
96
|
async def click_webhook(request: Request, db: Session = Depends(get_db)):
|
|
96
97
|
handler = CustomClickWebhookHandler(
|
|
97
98
|
db=db,
|
|
98
99
|
service_id="your_service_id",
|
|
99
|
-
merchant_id="your_merchant_id",
|
|
100
100
|
secret_key="your_secret_key",
|
|
101
101
|
account_model=Order
|
|
102
102
|
)
|
|
@@ -7,11 +7,10 @@ import json
|
|
|
7
7
|
import logging
|
|
8
8
|
from datetime import datetime
|
|
9
9
|
from decimal import Decimal
|
|
10
|
-
from typing import Dict, Any, Optional
|
|
10
|
+
from typing import Dict, Any, Optional
|
|
11
11
|
|
|
12
12
|
from fastapi import (
|
|
13
13
|
APIRouter,
|
|
14
|
-
Depends,
|
|
15
14
|
HTTPException,
|
|
16
15
|
Request,
|
|
17
16
|
Response,
|
|
@@ -919,37 +918,48 @@ class ClickWebhookHandler:
|
|
|
919
918
|
"""
|
|
920
919
|
Check authentication using signature.
|
|
921
920
|
"""
|
|
922
|
-
if
|
|
921
|
+
if not all([self.service_id, self.secret_key]):
|
|
923
922
|
raise HTTPException(
|
|
924
923
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
925
|
-
detail="
|
|
924
|
+
detail="Missing required settings: service_id or secret_key"
|
|
926
925
|
)
|
|
927
926
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
927
|
+
if str(params.get("service_id")) != self.service_id:
|
|
928
|
+
raise HTTPException(
|
|
929
|
+
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
930
|
+
detail="Invalid service ID"
|
|
931
|
+
)
|
|
932
932
|
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
936
|
-
detail="Missing signature parameters"
|
|
937
|
-
)
|
|
933
|
+
sign_string = params.get("sign_string")
|
|
934
|
+
sign_time = params.get("sign_time")
|
|
938
935
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
936
|
+
if not sign_string or not sign_time:
|
|
937
|
+
raise HTTPException(
|
|
938
|
+
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
939
|
+
detail="Missing signature parameters"
|
|
940
|
+
)
|
|
944
941
|
|
|
945
|
-
|
|
946
|
-
|
|
942
|
+
# Prepare signature components
|
|
943
|
+
text_parts = [
|
|
944
|
+
str(params.get("click_trans_id") or ""),
|
|
945
|
+
str(params.get("service_id") or ""),
|
|
946
|
+
str(self.secret_key or ""),
|
|
947
|
+
str(params.get("merchant_trans_id") or ""),
|
|
948
|
+
str(params.get("merchant_prepare_id") or ""),
|
|
949
|
+
str(params.get("amount") or ""),
|
|
950
|
+
str(params.get("action") or ""),
|
|
951
|
+
str(sign_time)
|
|
952
|
+
]
|
|
953
|
+
|
|
954
|
+
# Calculate hash
|
|
955
|
+
calculated_hash = hashlib.md5("".join(text_parts).encode("utf-8")).hexdigest()
|
|
956
|
+
|
|
957
|
+
if calculated_hash != sign_string:
|
|
958
|
+
raise HTTPException(
|
|
959
|
+
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
960
|
+
detail="Invalid signature"
|
|
961
|
+
)
|
|
947
962
|
|
|
948
|
-
if signature != sign_string:
|
|
949
|
-
raise HTTPException(
|
|
950
|
-
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
951
|
-
detail="Invalid signature"
|
|
952
|
-
)
|
|
953
963
|
|
|
954
964
|
def _find_account(self, merchant_trans_id: str) -> Any:
|
|
955
965
|
"""
|
|
@@ -6,7 +6,7 @@ payment systems in Uzbekistan. It supports Django, Flask, and FastAPI.
|
|
|
6
6
|
"""
|
|
7
7
|
from typing import Any
|
|
8
8
|
|
|
9
|
-
__version__ = '0.2.
|
|
9
|
+
__version__ = '0.2.19'
|
|
10
10
|
|
|
11
11
|
# Import framework integrations - these imports are used to check availability
|
|
12
12
|
# of frameworks, not for direct usage
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: paytechuz
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.19
|
|
4
4
|
Summary: Unified Python package for Uzbekistan payment gateways
|
|
5
5
|
Home-page: https://github.com/Muhammadali-Akbarov/paytechuz
|
|
6
6
|
Author: Muhammadali Akbarov
|
|
@@ -298,7 +298,6 @@ async def click_webhook(request: Request, db: Session = Depends(get_db)):
|
|
|
298
298
|
handler = CustomClickWebhookHandler(
|
|
299
299
|
db=db,
|
|
300
300
|
service_id="your_service_id",
|
|
301
|
-
merchant_id="your_merchant_id",
|
|
302
301
|
secret_key="your_secret_key",
|
|
303
302
|
account_model=Order
|
|
304
303
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/migrations/0001_initial.py
RENAMED
|
File without changes
|
{paytechuz-0.2.17 → paytechuz-0.2.19}/src/paytechuz/integrations/django/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|