paytechuz 0.1.6__py3-none-any.whl → 0.2.0__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 CHANGED
@@ -28,46 +28,13 @@ try:
28
28
  except ImportError:
29
29
  HAS_FLASK = False
30
30
 
31
-
32
- # Import the main classes for easier access
33
- try:
34
- from paytechuz.gateways.payme.client import PaymeGateway # noqa: E402
35
- from paytechuz.gateways.click.client import ClickGateway # noqa: E402
36
- from paytechuz.core.constants import PaymentGateway # noqa: E402
37
- except ImportError:
38
- # Fallback for development mode
39
- try:
40
- from .gateways.payme.client import PaymeGateway # noqa: E402
41
- from .gateways.click.client import ClickGateway # noqa: E402
42
- from .core.constants import PaymentGateway # noqa: E402
43
- except ImportError:
44
- # Dummy classes to avoid import errors
45
- class PaymeGateway:
46
- """Dummy PaymeGateway class to avoid import errors."""
47
- def __init__(self, **kwargs):
48
- pass
49
-
50
- def create_payment(self, **kwargs):
51
- return "https://test.paycom.uz/dummy-payment-url"
52
-
53
- class ClickGateway:
54
- """Dummy ClickGateway class to avoid import errors."""
55
- def __init__(self, **kwargs):
56
- pass
57
-
58
- def create_payment(self, **kwargs):
59
- return {"payment_url": "https://my.click.uz/dummy-payment-url"}
60
-
61
- class PaymentGateway:
62
- """Dummy PaymentGateway enum to avoid import errors."""
63
- class PAYME:
64
- value = 'payme'
65
-
66
- class CLICK:
67
- value = 'click'
31
+ from paytechuz.core.base import BasePaymentGateway # noqa: E402
32
+ from paytechuz.gateways.payme.client import PaymeGateway # noqa: E402
33
+ from paytechuz.gateways.click.client import ClickGateway # noqa: E402
34
+ from paytechuz.core.constants import PaymentGateway # noqa: E402
68
35
 
69
36
 
70
- def create_gateway(gateway_type: str, **kwargs) -> Any:
37
+ def create_gateway(gateway_type: str, **kwargs) -> BasePaymentGateway:
71
38
  """
72
39
  Create a payment gateway instance.
73
40
 
@@ -4,20 +4,21 @@ Click payment gateway client.
4
4
  import logging
5
5
  from typing import Dict, Any, Optional, Union
6
6
 
7
- from ....core.base import BasePaymentGateway
8
- from ....core.http import HttpClient
9
- from ....core.constants import ClickNetworks
10
- from ....core.utils import format_amount, handle_exceptions
7
+ from paytechuz.core.base import BasePaymentGateway
8
+ from paytechuz.core.http import HttpClient
9
+ from paytechuz.core.constants import ClickNetworks
10
+ from paytechuz.core.utils import format_amount, handle_exceptions
11
11
  from .merchant import ClickMerchantApi
12
12
 
13
13
  logger = logging.getLogger(__name__)
14
14
 
15
+
15
16
  class ClickGateway(BasePaymentGateway):
16
17
  """
17
18
  Click payment gateway implementation.
18
19
 
19
20
  This class provides methods for interacting with the Click payment gateway,
20
- including creating payments, checking payment status, and canceling payments.
21
+ including creating payments, checking payment status, and canceling payments. # noqa
21
22
  """
22
23
 
23
24
  def __init__(
@@ -45,7 +46,7 @@ class ClickGateway(BasePaymentGateway):
45
46
  self.secret_key = secret_key
46
47
 
47
48
  # Set the API URL based on the environment
48
- url = ClickNetworks.TEST_NET if is_test_mode else ClickNetworks.PROD_NET
49
+ url = ClickNetworks.TEST_NET if is_test_mode else ClickNetworks.PROD_NET # noqa
49
50
 
50
51
  # Initialize HTTP client
51
52
  self.http_client = HttpClient(base_url=url)
@@ -80,13 +81,13 @@ class ClickGateway(BasePaymentGateway):
80
81
  - email: Customer email
81
82
 
82
83
  Returns:
83
- Dict containing payment details including transaction ID and payment URL
84
+ Dict containing payment details including transaction ID and payment URL # noqa
84
85
  """
85
86
  # Format amount to tiyin (1 som = 100 tiyin)
86
87
  amount_tiyin = format_amount(amount)
87
88
 
88
89
  # Extract additional parameters
89
- description = kwargs.get('description', f'Payment for account {account_id}')
90
+ description = kwargs.get('description', f'Payment for account {account_id}') # noqa
90
91
  return_url = kwargs.get('return_url')
91
92
  callback_url = kwargs.get('callback_url')
92
93
  # These parameters are not used in the URL but are available in the API
@@ -138,7 +139,7 @@ class ClickGateway(BasePaymentGateway):
138
139
  # Format: click_account_id_amount
139
140
  parts = transaction_id.split('_')
140
141
  if len(parts) < 3 or parts[0] != 'click':
141
- raise ValueError(f"Invalid transaction ID format: {transaction_id}")
142
+ raise ValueError(f"Invalid transaction ID format: {transaction_id}") # noqa
142
143
 
143
144
  account_id = parts[1]
144
145
 
@@ -187,7 +188,7 @@ class ClickGateway(BasePaymentGateway):
187
188
  # Format: click_account_id_amount
188
189
  parts = transaction_id.split('_')
189
190
  if len(parts) < 3 or parts[0] != 'click':
190
- raise ValueError(f"Invalid transaction ID format: {transaction_id}")
191
+ raise ValueError(f"Invalid transaction ID format: {transaction_id}") # noqa
191
192
 
192
193
  account_id = parts[1]
193
194
 
@@ -5,9 +5,9 @@ import hashlib
5
5
  import logging
6
6
  from typing import Dict, Any, Optional, Union
7
7
 
8
- from ....core.http import HttpClient
9
- from ....core.constants import ClickEndpoints
10
- from ....core.utils import handle_exceptions, generate_timestamp
8
+ from paytechuz.core.http import HttpClient
9
+ from paytechuz.core.constants import ClickEndpoints
10
+ from paytechuz.core.utils import handle_exceptions, generate_timestamp
11
11
 
12
12
  logger = logging.getLogger(__name__)
13
13
 
@@ -4,9 +4,9 @@ Payme cards operations.
4
4
  import logging
5
5
  from typing import Dict, Any
6
6
 
7
- from ....core.http import HttpClient
8
- from ....core.constants import PaymeEndpoints
9
- from ....core.utils import handle_exceptions
7
+ from paytechuz.core.http import HttpClient
8
+ from paytechuz.core.constants import PaymeEndpoints
9
+ from paytechuz.core.utils import handle_exceptions
10
10
 
11
11
  logger = logging.getLogger(__name__)
12
12
 
@@ -5,10 +5,10 @@ import logging
5
5
  from typing import Dict, Any, Optional, Union
6
6
  import base64
7
7
 
8
- from ....core.base import BasePaymentGateway
9
- from ....core.http import HttpClient
10
- from ....core.constants import PaymeNetworks
11
- from ....core.utils import format_amount, handle_exceptions
8
+ from paytechuz.core.base import BasePaymentGateway
9
+ from paytechuz.core.http import HttpClient
10
+ from paytechuz.core.constants import PaymeNetworks
11
+ from paytechuz.core.utils import format_amount, handle_exceptions
12
12
  from .cards import PaymeCards
13
13
  from .receipts import PaymeReceipts
14
14
 
@@ -5,9 +5,9 @@ Payme receipts operations.
5
5
  import logging
6
6
  from typing import Dict, Any, Optional
7
7
 
8
- from ....core.http import HttpClient
9
- from ....core.constants import PaymeEndpoints
10
- from ....core.utils import handle_exceptions, generate_basic_auth
8
+ from paytechuz.core.http import HttpClient
9
+ from paytechuz.core.constants import PaymeEndpoints
10
+ from paytechuz.core.utils import handle_exceptions, generate_basic_auth
11
11
 
12
12
  logger = logging.getLogger(__name__)
13
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.1.6
3
+ Version: 0.2.0
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
@@ -1,4 +1,4 @@
1
- paytechuz/__init__.py,sha256=IpHrtevEvKObpWfZjT286sZSEYFJyzSYfiZAiIm0CYE,2856
1
+ paytechuz/__init__.py,sha256=N7ORpNWx0QjT5ShnYNJXj5ph-EXTQN3629vzFOwNaUE,1758
2
2
  paytechuz/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  paytechuz/core/base.py,sha256=pW_0QrlyX0F8XVToeeDEI78ygAF2IgvvvyUGYMHH9bs,2565
4
4
  paytechuz/core/constants.py,sha256=P2zeZ_cfZIttdC1vqkpIngkfRFh6loWzJYEgzQb5cKA,1660
@@ -8,13 +8,13 @@ paytechuz/core/utils.py,sha256=EbNtDweR1ABOtCu4D6cYlolM0t_fbiE3gNoc_qfcKKA,4704
8
8
  paytechuz/core/payme/errors.py,sha256=CZE62MbYDMsRfNIX23Syt6of_tPMMGLnXhYMii4hw3A,542
9
9
  paytechuz/gateways/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  paytechuz/gateways/click/__init__.py,sha256=35RPIrZYHgMWDzxjQkJMZYjzHDa8cY_BqQztCdZZmBM,90
11
- paytechuz/gateways/click/client.py,sha256=YWvgkBoBeZf9SIYi09kIMiiWkf6M5wbR4Jc8k1z5mRA,6615
12
- paytechuz/gateways/click/merchant.py,sha256=9xbn7LD7CMBE0k6h5AVcsWpDjOaWudhxvf2QrmqbkoA,7236
11
+ paytechuz/gateways/click/client.py,sha256=NC9bHP2A_9ZagE1G4OBrckvefLhyALzs76tzKoc6x8U,6682
12
+ paytechuz/gateways/click/merchant.py,sha256=vJ_DivA1KfRT5p3sfA5yZGMYXoUmVbAM7QHvaXr6VCU,7254
13
13
  paytechuz/gateways/click/webhook.py,sha256=rph-NmjjnBKMW4rcxQTXrHHdK-uMrU39kXnbqK56leo,7936
14
14
  paytechuz/gateways/payme/__init__.py,sha256=KcVkYvAEblL4ASVAOrUofRBwywAkTZIgRXoBaCbYtv8,90
15
- paytechuz/gateways/payme/cards.py,sha256=0uAfPD5tZZg0puqOjkodcWUxhMgqKeyvFpgenruMuSQ,5402
16
- paytechuz/gateways/payme/client.py,sha256=TK1ZwWHcabbPiRujbPOTFchPSjyt7V13KP6xfCgSm2A,7783
17
- paytechuz/gateways/payme/receipts.py,sha256=uLoFpowIqZtj3lPWmUvmpBEGfhwAPWt5Sl16OJHfiEI,8886
15
+ paytechuz/gateways/payme/cards.py,sha256=aL6su_ZTCBPU8qmrz2Jcw_Wn7Zf9RwIu8k10o4AWFTs,5420
16
+ paytechuz/gateways/payme/client.py,sha256=TitVYANv3S5VmD4ztShY0mRv4EbVLMvTiBeKJnvOzwI,7807
17
+ paytechuz/gateways/payme/receipts.py,sha256=DdrZMPeDvQmGyqAEOTmtUorfcIVVb3t2tg31l7TXqHo,8904
18
18
  paytechuz/gateways/payme/webhook.py,sha256=-0O8vzMtiu4U8FWFKDA6EfyoX4NEGqcEq-T0yNtVhM4,12374
19
19
  paytechuz/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  paytechuz/integrations/django/__init__.py,sha256=YDgD1Ux1E3CJxQMT-9tulhXmuLOEaUSv320LeaVgJ00,116
@@ -30,7 +30,7 @@ paytechuz/integrations/fastapi/__init__.py,sha256=DLnhAZQZf2ghu8BuFFfE7FzbNKWQQ2
30
30
  paytechuz/integrations/fastapi/models.py,sha256=eWGUpiKufj47AK8Hld4A91jRDj0ZKQzAf95CyUozmvo,4638
31
31
  paytechuz/integrations/fastapi/routes.py,sha256=D17QeyY4-aX6tCNmk5h3UiavukvVrE5e6JOFCy4t_n8,36629
32
32
  paytechuz/integrations/fastapi/schemas.py,sha256=CkNohj22mQQje8Pu_IkTQwUPAoYHNOKXlGjqaRX_SGQ,3784
33
- paytechuz-0.1.6.dist-info/METADATA,sha256=2h0tyvJXvI-SAhqacd6Mdl-CuljKpLpb2q5FMNdB3dM,4149
34
- paytechuz-0.1.6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
35
- paytechuz-0.1.6.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
36
- paytechuz-0.1.6.dist-info/RECORD,,
33
+ paytechuz-0.2.0.dist-info/METADATA,sha256=PLlxhhK3dKrjJKzHb8KJONhgJdKKWiSC43Ud1mQ-ht0,4149
34
+ paytechuz-0.2.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
35
+ paytechuz-0.2.0.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
36
+ paytechuz-0.2.0.dist-info/RECORD,,