paytechuz 0.2.12__py3-none-any.whl → 0.2.13__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.

@@ -38,30 +38,37 @@ class PaymeWebhook(View):
38
38
  def __init__(self, **kwargs):
39
39
  super().__init__(**kwargs)
40
40
 
41
- # Try to get the account model from settings
42
- # Get the account model from settings
43
- account_model_path = getattr(
44
- settings, 'PAYME_ACCOUNT_MODEL', 'django.contrib.auth.models.User'
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 PAYME_ACCOUNT_MODEL setting.",
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 = getattr(settings, 'PAYME_ACCOUNT_FIELD', 'id')
59
- self.amount_field = getattr(settings, 'PAYME_AMOUNT_FIELD', 'amount')
60
- self.one_time_payment = getattr(
61
- settings, 'PAYME_ONE_TIME_PAYMENT', True
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
- # Try to get the account model from settings
584
- # Get the account model from settings
585
- account_model_path = getattr(
586
- settings, 'CLICK_ACCOUNT_MODEL', 'django.contrib.auth.models.User'
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 CLICK_ACCOUNT_MODEL setting.",
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 = getattr(settings, 'CLICK_SERVICE_ID', '')
601
- self.secret_key = getattr(settings, 'CLICK_SECRET_KEY', '')
602
- self.commission_percent = getattr(
603
- settings, 'CLICK_COMMISSION_PERCENT', 0.0
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.12
3
+ Version: 0.2.13
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
  [![PyPI version](https://badge.fury.io/py/paytechuz.svg)](https://badge.fury.io/py/paytechuz)
19
19
  [![Python Versions](https://img.shields.io/pypi/pyversions/paytechuz.svg)](https://pypi.org/project/paytechuz/)
20
+ [![Documentation](https://img.shields.io/badge/docs-pay--tech.uz-blue.svg)](https://pay-tech.uz)
20
21
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- PAYME_ID = 'your_payme_merchant_id'
125
- PAYME_KEY = 'your_payme_merchant_key'
126
- PAYME_ACCOUNT_MODEL = 'your_app.models.Order' # For example: 'orders.models.Order'
127
- PAYME_ACCOUNT_FIELD = 'id'
128
- PAYME_AMOUNT_FIELD = 'amount' # Field for storing payment amount
129
- PAYME_ONE_TIME_PAYMENT = True # Allow only one payment per account
130
-
131
- CLICK_SERVICE_ID = 'your_click_service_id'
132
- CLICK_MERCHANT_ID = 'your_click_merchant_id'
133
- CLICK_SECRET_KEY = 'your_click_secret_key'
134
- CLICK_ACCOUNT_MODEL = 'your_app.models.Order'
135
- CLICK_COMMISSION_PERCENT = 0.0
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.
@@ -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=cP_Jc3VlyyvyzDbBd2yEVHikw60th1_-L9_vtsRfwgs,31335
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.12.dist-info/METADATA,sha256=B74_kgLXWLplvdXC2oKQidr-qcELwOBjtyMp2kyL1pQ,9414
34
- paytechuz-0.2.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- paytechuz-0.2.12.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
36
- paytechuz-0.2.12.dist-info/RECORD,,
33
+ paytechuz-0.2.13.dist-info/METADATA,sha256=tmEwfjF5gsTPP92RIpCWALNwBAZmDkzKv84H6dkQJPw,10124
34
+ paytechuz-0.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ paytechuz-0.2.13.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
36
+ paytechuz-0.2.13.dist-info/RECORD,,