paytechuz 0.2.12__py3-none-any.whl → 0.2.14__py3-none-any.whl
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/__init__.py +1 -1
- paytechuz/integrations/django/webhooks.py +41 -28
- {paytechuz-0.2.12.dist-info → paytechuz-0.2.14.dist-info}/METADATA +30 -13
- {paytechuz-0.2.12.dist-info → paytechuz-0.2.14.dist-info}/RECORD +6 -6
- {paytechuz-0.2.12.dist-info → paytechuz-0.2.14.dist-info}/WHEEL +0 -0
- {paytechuz-0.2.12.dist-info → paytechuz-0.2.14.dist-info}/top_level.txt +0 -0
paytechuz/__init__.py
CHANGED
|
@@ -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.14'
|
|
10
10
|
|
|
11
11
|
# Import framework integrations - these imports are used to check availability
|
|
12
12
|
# of frameworks, not for direct usage
|
|
@@ -38,30 +38,37 @@ class PaymeWebhook(View):
|
|
|
38
38
|
def __init__(self, **kwargs):
|
|
39
39
|
super().__init__(**kwargs)
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
paytechuz_settings = getattr(settings, 'PAYTECHUZ', {})
|
|
42
|
+
payme_settings = paytechuz_settings.get('PAYME', {})
|
|
43
|
+
|
|
44
|
+
self.payme_id = payme_settings.get('PAYME_ID') or getattr(settings, 'PAYME_ID', '')
|
|
45
|
+
self.payme_key = payme_settings.get('PAYME_KEY') or getattr(settings, 'PAYME_KEY', '')
|
|
46
|
+
|
|
47
|
+
account_model_path = (
|
|
48
|
+
payme_settings.get('ACCOUNT_MODEL') or
|
|
49
|
+
getattr(settings, 'PAYME_ACCOUNT_MODEL', 'django.contrib.auth.models.User')
|
|
45
50
|
)
|
|
46
51
|
try:
|
|
47
52
|
self.account_model = import_string(account_model_path)
|
|
48
53
|
except ImportError:
|
|
49
|
-
# If the model is not found, log an error and raise an exception
|
|
50
54
|
logger.error(
|
|
51
|
-
"Could not import %s. Check
|
|
55
|
+
"Could not import %s. Check PAYTECHUZ.PAYME.ACCOUNT_MODEL setting.",
|
|
52
56
|
account_model_path
|
|
53
57
|
)
|
|
54
|
-
raise ImportError(
|
|
55
|
-
f"Import error: {account_model_path}"
|
|
56
|
-
) from None
|
|
58
|
+
raise ImportError(f"Import error: {account_model_path}") from None
|
|
57
59
|
|
|
58
|
-
self.account_field =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
self.account_field = (
|
|
61
|
+
payme_settings.get('ACCOUNT_FIELD') or
|
|
62
|
+
getattr(settings, 'PAYME_ACCOUNT_FIELD', 'id')
|
|
63
|
+
)
|
|
64
|
+
self.amount_field = (
|
|
65
|
+
payme_settings.get('AMOUNT_FIELD') or
|
|
66
|
+
getattr(settings, 'PAYME_AMOUNT_FIELD', 'amount')
|
|
67
|
+
)
|
|
68
|
+
self.one_time_payment = (
|
|
69
|
+
payme_settings.get('ONE_TIME_PAYMENT') or
|
|
70
|
+
getattr(settings, 'PAYME_ONE_TIME_PAYMENT', True)
|
|
62
71
|
)
|
|
63
|
-
self.payme_id = getattr(settings, 'PAYME_ID', '')
|
|
64
|
-
self.payme_key = getattr(settings, 'PAYME_KEY', '')
|
|
65
72
|
|
|
66
73
|
def post(self, request, **_):
|
|
67
74
|
"""
|
|
@@ -580,27 +587,33 @@ class ClickWebhook(View):
|
|
|
580
587
|
def __init__(self, **kwargs):
|
|
581
588
|
super().__init__(**kwargs)
|
|
582
589
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
590
|
+
paytechuz_settings = getattr(settings, 'PAYTECHUZ', {})
|
|
591
|
+
click_settings = paytechuz_settings.get('CLICK', {})
|
|
592
|
+
|
|
593
|
+
account_model_path = (
|
|
594
|
+
click_settings.get('ACCOUNT_MODEL') or
|
|
595
|
+
getattr(settings, 'CLICK_ACCOUNT_MODEL')
|
|
587
596
|
)
|
|
588
597
|
try:
|
|
589
598
|
self.account_model = import_string(account_model_path)
|
|
590
599
|
except ImportError:
|
|
591
|
-
# If the model is not found, log an error and raise an exception
|
|
592
600
|
logger.error(
|
|
593
|
-
"Could not import %s. Check
|
|
601
|
+
"Could not import %s. Check PAYTECHUZ.CLICK.ACCOUNT_MODEL setting.",
|
|
594
602
|
account_model_path
|
|
595
603
|
)
|
|
596
|
-
raise ImportError(
|
|
597
|
-
f"Import error: {account_model_path}"
|
|
598
|
-
) from None
|
|
604
|
+
raise ImportError(f"Import error: {account_model_path}") from None
|
|
599
605
|
|
|
600
|
-
self.service_id =
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
606
|
+
self.service_id = (
|
|
607
|
+
click_settings.get('SERVICE_ID') or
|
|
608
|
+
getattr(settings, 'CLICK_SERVICE_ID', '')
|
|
609
|
+
)
|
|
610
|
+
self.secret_key = (
|
|
611
|
+
click_settings.get('SECRET_KEY') or
|
|
612
|
+
getattr(settings, 'CLICK_SECRET_KEY', '')
|
|
613
|
+
)
|
|
614
|
+
self.commission_percent = (
|
|
615
|
+
click_settings.get('COMMISSION_PERCENT') or
|
|
616
|
+
getattr(settings, 'CLICK_COMMISSION_PERCENT', 0.0)
|
|
604
617
|
)
|
|
605
618
|
|
|
606
619
|
def post(self, request, **_):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: paytechuz
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.14
|
|
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
|
|
@@ -17,10 +17,13 @@ Dynamic: requires-python
|
|
|
17
17
|
|
|
18
18
|
[](https://badge.fury.io/py/paytechuz)
|
|
19
19
|
[](https://pypi.org/project/paytechuz/)
|
|
20
|
+
[](https://pay-tech.uz)
|
|
20
21
|
[](https://opensource.org/licenses/MIT)
|
|
21
22
|
|
|
22
23
|
PayTechUZ is a unified payment library for integrating with popular payment systems in Uzbekistan. It provides a simple and consistent interface for working with Payme and Click payment gateways.
|
|
23
24
|
|
|
25
|
+
📖 **[Complete Documentation](https://pay-tech.uz)** | 🚀 **[Quick Start Guide](https://pay-tech.uz/quickstart)**
|
|
26
|
+
|
|
24
27
|
## Features
|
|
25
28
|
|
|
26
29
|
- 🔄 **API**: Consistent interface for multiple payment providers
|
|
@@ -49,6 +52,8 @@ pip install paytechuz[fastapi]
|
|
|
49
52
|
|
|
50
53
|
## Quick Start
|
|
51
54
|
|
|
55
|
+
> 💡 **Need help?** Check out our [complete documentation](https://pay-tech.uz) for detailed guides and examples.
|
|
56
|
+
|
|
52
57
|
### Generate Payment Links
|
|
53
58
|
|
|
54
59
|
```python
|
|
@@ -121,18 +126,26 @@ INSTALLED_APPS = [
|
|
|
121
126
|
'paytechuz.integrations.django',
|
|
122
127
|
]
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
PAYTECHUZ = {
|
|
130
|
+
'PAYME': {
|
|
131
|
+
'PAYME_ID': 'your_payme_id',
|
|
132
|
+
'PAYME_KEY': 'your_payme_key',
|
|
133
|
+
'ACCOUNT_MODEL': 'your_app.models.Order', # For example: 'orders.models.Order'
|
|
134
|
+
'ACCOUNT_FIELD': 'id',
|
|
135
|
+
'AMOUNT_FIELD': 'amount',
|
|
136
|
+
'ONE_TIME_PAYMENT': True,
|
|
137
|
+
'IS_TEST_MODE': True, # Set to False in production
|
|
138
|
+
},
|
|
139
|
+
'CLICK': {
|
|
140
|
+
'SERVICE_ID': 'your_service_id',
|
|
141
|
+
'MERCHANT_ID': 'your_merchant_id',
|
|
142
|
+
'MERCHANT_USER_ID': 'your_merchant_user_id',
|
|
143
|
+
'SECRET_KEY': 'your_secret_key',
|
|
144
|
+
'ACCOUNT_MODEL': 'your_app.models.Order',
|
|
145
|
+
'COMMISSION_PERCENT': 0.0,
|
|
146
|
+
'IS_TEST_MODE': True, # Set to False in production
|
|
147
|
+
}
|
|
148
|
+
}
|
|
136
149
|
```
|
|
137
150
|
|
|
138
151
|
3. Create webhook handlers:
|
|
@@ -313,6 +326,10 @@ Detailed documentation is available in multiple languages:
|
|
|
313
326
|
|
|
314
327
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
315
328
|
|
|
329
|
+
📖 **Documentation:** [pay-tech.uz](https://pay-tech.uz)
|
|
330
|
+
🐛 **Issues:** [GitHub Issues](https://github.com/PayTechUz/paytechuz-py/issues)
|
|
331
|
+
💬 **Support:** [Telegram](https://t.me/paytechuz)
|
|
332
|
+
|
|
316
333
|
## License
|
|
317
334
|
|
|
318
335
|
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
paytechuz/__init__.py,sha256=
|
|
1
|
+
paytechuz/__init__.py,sha256=2gGVSzGDAgscDHFbWNXw9fmocvWQz0oJTyuWOIFxnxs,1754
|
|
2
2
|
paytechuz/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
paytechuz/core/base.py,sha256=Es6eEGNgDjQJe-kEJVAHSAh8AWbgtIuQMm0xn7qfjl4,2549
|
|
4
4
|
paytechuz/core/constants.py,sha256=P2zeZ_cfZIttdC1vqkpIngkfRFh6loWzJYEgzQb5cKA,1660
|
|
@@ -23,14 +23,14 @@ paytechuz/integrations/django/apps.py,sha256=Q9wG2osL7_Ip2BcAkq7lmmhu4UKJAg6UtSs
|
|
|
23
23
|
paytechuz/integrations/django/models.py,sha256=x3cVLY812Xts5oNk4VmCzK3zjb0FXQON9WV41PCtxaw,5696
|
|
24
24
|
paytechuz/integrations/django/signals.py,sha256=VtNYEAnu13wi9PqadEaCU9LY_k2tY26AS4bnPIAqw7M,1319
|
|
25
25
|
paytechuz/integrations/django/views.py,sha256=TL-LNbwrLvYjoBvGxm_yZjMVLBqelorgKjr4l3sKH1Y,3037
|
|
26
|
-
paytechuz/integrations/django/webhooks.py,sha256=
|
|
26
|
+
paytechuz/integrations/django/webhooks.py,sha256=6GlLgLEizMjkD7dYR3AoLcLmZnMPwi3IaqB0Kln7dSk,31759
|
|
27
27
|
paytechuz/integrations/django/migrations/0001_initial.py,sha256=SWHIUuwq91crzaxa9v1UK0kay8CxsjUo6t4bqg7j0Gw,1896
|
|
28
28
|
paytechuz/integrations/django/migrations/__init__.py,sha256=KLQ5NdjOMLDS21-u3b_g08G1MjPMMhG95XI_N8m4FSo,41
|
|
29
29
|
paytechuz/integrations/fastapi/__init__.py,sha256=DLnhAZQZf2ghu8BuFFfE7FzbNKWQQ2SLG8qxldRuwR4,565
|
|
30
30
|
paytechuz/integrations/fastapi/models.py,sha256=9IqrsndIVuIDwDbijZ89biJxEWQASXRBfWVShxgerAc,5113
|
|
31
31
|
paytechuz/integrations/fastapi/routes.py,sha256=61jsHsgGJZ_-ISfG2J1MSOCqIOLQ18C1boc9MVddkvg,37652
|
|
32
32
|
paytechuz/integrations/fastapi/schemas.py,sha256=PgRqviJiD4-u3_CIkUOX8R7L8Yqn8L44WLte7968G0E,3887
|
|
33
|
-
paytechuz-0.2.
|
|
34
|
-
paytechuz-0.2.
|
|
35
|
-
paytechuz-0.2.
|
|
36
|
-
paytechuz-0.2.
|
|
33
|
+
paytechuz-0.2.14.dist-info/METADATA,sha256=9hi7VvJd3sccewhAPuj4MvILvtNnyDtOts686ENptbI,10124
|
|
34
|
+
paytechuz-0.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
35
|
+
paytechuz-0.2.14.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
|
|
36
|
+
paytechuz-0.2.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|