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

@@ -1,42 +1,17 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.2.21
3
+ Version: 0.2.22
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
7
7
  Author-email: muhammadali17abc@gmail.com
8
8
  License: MIT
9
- Keywords: paytechuz,payme,click,uzbekistan,payment,gateway,payment-gateway,payment-processing,django,flask,fastapi
10
- Platform: UNKNOWN
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.6
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: License :: OSI Approved :: MIT License
22
- Classifier: Operating System :: OS Independent
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
9
  Requires-Python: >=3.6
25
10
  Description-Content-Type: text/markdown
26
- Requires-Dist: requests<3.0,>=2.0
27
- Requires-Dist: dataclasses<1.0,>=0.6; python_version < "3.7"
28
- Provides-Extra: django
29
- Requires-Dist: django<5.0,>=3.0; extra == "django"
30
- Requires-Dist: djangorestframework<4.0,>=3.0; extra == "django"
31
- Provides-Extra: fastapi
32
- Requires-Dist: fastapi<1.0.0,>=0.68.0; extra == "fastapi"
33
- Requires-Dist: sqlalchemy<3.0,>=1.4; extra == "fastapi"
34
- Requires-Dist: httpx<1.0,>=0.20; extra == "fastapi"
35
- Requires-Dist: python-multipart==0.0.20; extra == "fastapi"
36
- Requires-Dist: pydantic<2.0,>=1.8; extra == "fastapi"
37
- Provides-Extra: flask
38
- Requires-Dist: flask<3.0,>=2.0; extra == "flask"
39
- Requires-Dist: flask-sqlalchemy<3.0,>=2.5; extra == "flask"
11
+ Dynamic: author
12
+ Dynamic: author-email
13
+ Dynamic: home-page
14
+ Dynamic: requires-python
40
15
 
41
16
  # paytechuz
42
17
 
@@ -357,5 +332,3 @@ Contributions are welcome! Please feel free to submit a Pull Request.
357
332
  ## License
358
333
 
359
334
  This project is licensed under the MIT License - see the LICENSE file for details.
360
-
361
-
@@ -1,34 +1,3 @@
1
- core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- core/base.py,sha256=Es6eEGNgDjQJe-kEJVAHSAh8AWbgtIuQMm0xn7qfjl4,2549
3
- core/constants.py,sha256=P2zeZ_cfZIttdC1vqkpIngkfRFh6loWzJYEgzQb5cKA,1660
4
- core/exceptions.py,sha256=XMJkqiponTkvhjoh3S2iFNuU3UbBdFW4130kd0hpudg,5489
5
- core/http.py,sha256=qmLR6ujxmIPjwoTS4vvKRIvDnNcpl84sS1HmVB890b0,7686
6
- core/utils.py,sha256=ETHMzwu7_dirc-QfBUjpSTQmyS6_vBiNq97Dq9CNZto,4718
7
- core/payme/errors.py,sha256=CZE62MbYDMsRfNIX23Syt6of_tPMMGLnXhYMii4hw3A,542
8
- gateways/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- gateways/click/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- gateways/click/client.py,sha256=UkzSd7FiYHoNUZayehhLn9GvTVPIdNOcmrcLCTKdWlA,6390
11
- gateways/click/merchant.py,sha256=lav5bz7E-saiKHqEFHL2GQ-UVZkUduXkx8thZ2X5y2Q,7183
12
- gateways/click/webhook.py,sha256=rph-NmjjnBKMW4rcxQTXrHHdK-uMrU39kXnbqK56leo,7936
13
- gateways/payme/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- gateways/payme/cards.py,sha256=aL6su_ZTCBPU8qmrz2Jcw_Wn7Zf9RwIu8k10o4AWFTs,5420
15
- gateways/payme/client.py,sha256=78NUHz4X6M5YIbWOYgKY4TKd-LOUYzFODaDPLFmgUCU,7839
16
- gateways/payme/receipts.py,sha256=DdrZMPeDvQmGyqAEOTmtUorfcIVVb3t2tg31l7TXqHo,8904
17
- gateways/payme/webhook.py,sha256=-0O8vzMtiu4U8FWFKDA6EfyoX4NEGqcEq-T0yNtVhM4,12374
18
- integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- integrations/django/__init__.py,sha256=YDgD1Ux1E3CJxQMT-9tulhXmuLOEaUSv320LeaVgJ00,116
20
- integrations/django/admin.py,sha256=6fs6GiKcdc-hGlLxJ0BthY7TFo_2RVVJRhQwhxMroCY,2664
21
- integrations/django/apps.py,sha256=57svd2aqSuoASWMI3Jnh70ZXrYN1oQ8EnvLl_5LNyl0,473
22
- integrations/django/models.py,sha256=83PjBnombavEjfPm2EcVFo2R5BO6VRIjp0MlNCp-fbg,5819
23
- integrations/django/signals.py,sha256=VtNYEAnu13wi9PqadEaCU9LY_k2tY26AS4bnPIAqw7M,1319
24
- integrations/django/views.py,sha256=r9DnbV2IBkFm18SBtan4lgrluaULLViKJIWGFTlHJH0,3031
25
- integrations/django/webhooks.py,sha256=dslVnFMl6QRI1wQVgMRjlIoFFJ4yEt9Nbs1sClbfjPw,31464
26
- integrations/django/migrations/0001_initial.py,sha256=YLDUp1w0V3Zvuz5TssQDrx3PlccduoHqdLD109Hg8Z4,2326
27
- integrations/django/migrations/__init__.py,sha256=KLQ5NdjOMLDS21-u3b_g08G1MjPMMhG95XI_N8m4FSo,41
28
- integrations/fastapi/__init__.py,sha256=DLnhAZQZf2ghu8BuFFfE7FzbNKWQQ2SLG8qxldRuwR4,565
29
- integrations/fastapi/models.py,sha256=qZe_Pz3qfL3fjRL99WVQfxGIW1Mt2JAPMQ98k86pUxU,5526
30
- integrations/fastapi/routes.py,sha256=dLInbxXrhzW7uFMA-TUmAE5v6nBX3RwAj8VMDrLmfAE,36876
31
- integrations/fastapi/schemas.py,sha256=uGuIcgsJ7eh5EHmdSjCxxBJC51WONA1OwPLPf_mpgHc,3867
32
1
  paytechuz/__init__.py,sha256=d-9AjWthchZAE_ykEjoBZ79o32gzqM1jZkkAQd-jB8s,1754
33
2
  paytechuz/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
3
  paytechuz/core/base.py,sha256=Es6eEGNgDjQJe-kEJVAHSAh8AWbgtIuQMm0xn7qfjl4,2549
@@ -61,7 +30,7 @@ paytechuz/integrations/fastapi/__init__.py,sha256=DLnhAZQZf2ghu8BuFFfE7FzbNKWQQ2
61
30
  paytechuz/integrations/fastapi/models.py,sha256=9IqrsndIVuIDwDbijZ89biJxEWQASXRBfWVShxgerAc,5113
62
31
  paytechuz/integrations/fastapi/routes.py,sha256=t8zbqhMZsaJmEvMDgmF-NoRmbqksfX_AvIrx-3kCjg8,37845
63
32
  paytechuz/integrations/fastapi/schemas.py,sha256=PgRqviJiD4-u3_CIkUOX8R7L8Yqn8L44WLte7968G0E,3887
64
- paytechuz-0.2.21.dist-info/METADATA,sha256=dHA9NdyvhNtzp8F0V7gmF8KC75OauwM_Yyy9cd8PRjw,11464
65
- paytechuz-0.2.21.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
66
- paytechuz-0.2.21.dist-info/top_level.txt,sha256=v03IobsNVIGSgCareObqCsEwLgXOpwBvBTWy3y8-G_M,37
67
- paytechuz-0.2.21.dist-info/RECORD,,
33
+ paytechuz-0.2.22.dist-info/METADATA,sha256=JNeDz3IQeu9uOtMOt48IsarEErU6mMLAv6GWndyBgW4,10084
34
+ paytechuz-0.2.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ paytechuz-0.2.22.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
36
+ paytechuz-0.2.22.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.45.1)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1 @@
1
+ paytechuz
core/__init__.py DELETED
File without changes
core/base.py DELETED
@@ -1,97 +0,0 @@
1
- """
2
- Base classes for payment gateways.
3
- """
4
- from abc import ABC, abstractmethod
5
- from typing import Dict, Any, Optional, Union
6
-
7
-
8
- class BasePaymentGateway(ABC):
9
- """
10
- Base class for all payment gateways.
11
-
12
- This abstract class defines the common interface that all payment gateways
13
- must implement. It provides a consistent API for creating, checking, and
14
- canceling payments regardless of the underlying payment provider.
15
- """
16
-
17
- def __init__(self, is_test_mode: bool = False):
18
- """
19
- Initialize the payment gateway.
20
-
21
- Args:
22
- is_test_mode (bool): Whether to use the test environment
23
- """
24
- self.is_test_mode = is_test_mode
25
-
26
- @abstractmethod
27
- def create_payment(
28
- self,
29
- id: Union[int, str],
30
- amount: Union[int, float, str],
31
- **kwargs
32
- ) -> Dict[str, Any]:
33
- """
34
- Create a payment.
35
-
36
- Args:
37
- id: The account ID or order ID
38
- amount: The payment amount
39
- **kwargs: Additional parameters specific to the payment gateway
40
-
41
- Returns:
42
- Dict containing payment details including transaction ID
43
- """
44
- raise NotImplementedError
45
-
46
- @abstractmethod
47
- def check_payment(self, transaction_id: str) -> Dict[str, Any]:
48
- """
49
- Check payment status.
50
-
51
- Args:
52
- transaction_id: The transaction ID to check
53
-
54
- Returns:
55
- Dict containing payment status and details
56
- """
57
- raise NotImplementedError
58
-
59
- @abstractmethod
60
- def cancel_payment(
61
- self,
62
- transaction_id: str,
63
- reason: Optional[str] = None
64
- ) -> Dict[str, Any]:
65
- """
66
- Cancel payment.
67
-
68
- Args:
69
- transaction_id: The transaction ID to cancel
70
- reason: Optional reason for cancellation
71
-
72
- Returns:
73
- Dict containing cancellation status and details
74
- """
75
- raise NotImplementedError
76
-
77
-
78
- class BaseWebhookHandler(ABC):
79
- """
80
- Base class for payment gateway webhook handlers.
81
-
82
- This abstract class defines the common interface for handling webhook
83
- callbacks from payment gateways.
84
- """
85
-
86
- @abstractmethod
87
- def handle_webhook(self, data: Dict[str, Any]) -> Dict[str, Any]:
88
- """
89
- Handle webhook data from payment gateway.
90
-
91
- Args:
92
- data: The webhook data received from the payment gateway
93
-
94
- Returns:
95
- Dict containing the response to be sent back to the payment gateway
96
- """
97
- raise NotImplementedError
core/constants.py DELETED
@@ -1,68 +0,0 @@
1
- """
2
- Constants for payment gateways.
3
- """
4
- from enum import Enum
5
-
6
- class TransactionState(Enum):
7
- """Transaction states."""
8
- CREATED = 0
9
- INITIATING = 1
10
- SUCCESSFULLY = 2
11
- CANCELED = -2
12
- CANCELED_DURING_INIT = -1
13
-
14
-
15
- class PaymentGateway(Enum):
16
- """Payment gateway types."""
17
- PAYME = "payme"
18
- CLICK = "click"
19
-
20
- class PaymeEndpoints:
21
- """Payme API endpoints."""
22
- RECEIPTS_CREATE = "receipts/create"
23
- RECEIPTS_PAY = "receipts/pay"
24
- RECEIPTS_SEND = "receipts/send"
25
- RECEIPTS_CHECK = "receipts/check"
26
- RECEIPTS_CANCEL = "receipts/cancel"
27
- RECEIPTS_GET = "receipts/get"
28
- CARDS_CREATE = "cards/create"
29
- CARDS_VERIFY = "cards/verify"
30
- CARDS_CHECK = "cards/check"
31
- CARDS_REMOVE = "cards/remove"
32
- CARDS_GET_VERIFY_CODE = "cards/get_verify_code"
33
-
34
-
35
- class PaymeNetworks:
36
- """Payme API networks."""
37
- TEST_NET = "https://checkout.test.paycom.uz/api"
38
- PROD_NET = "https://checkout.paycom.uz/api"
39
-
40
- class ClickEndpoints:
41
- """Click API endpoints."""
42
- PREPARE = "prepare"
43
- COMPLETE = "complete"
44
- MERCHANT_API = "merchant/api"
45
-
46
-
47
- class ClickNetworks:
48
- """Click API networks."""
49
- TEST_NET = "https://api.click.uz/v2/merchant"
50
- PROD_NET = "https://api.click.uz/v2/merchant"
51
-
52
- class ClickActions:
53
- """Click API actions."""
54
- PREPARE = 0
55
- COMPLETE = 1
56
-
57
-
58
- class PaymeCancelReason:
59
- """Payme cancel reason codes."""
60
- REASON_USER_NOT_FOUND = 1
61
- REASON_DEBIT_OPERATION_FAILED = 2
62
- REASON_EXECUTION_ERROR = 3
63
- REASON_TIMEOUT = 4
64
- REASON_FUND_RETURNED = 5
65
- REASON_UNKNOWN = 6
66
- REASON_CANCELLED_BY_USER = 7
67
- REASON_SUSPICIOUS_OPERATION = 8
68
- REASON_MERCHANT_DECISION = 9
core/exceptions.py DELETED
@@ -1,190 +0,0 @@
1
- """
2
- Exceptions for payment gateways.
3
- """
4
- from typing import Optional, Dict, Any
5
-
6
- class PaymentException(Exception):
7
- """Base exception for all payment exceptions."""
8
- code = "payment_error"
9
- message = "Payment error occurred"
10
- data: Dict[str, Any] = {}
11
-
12
- def __init__(self, message: Optional[str] = None, code: Optional[str] = None, data: Optional[Dict[str, Any]] = None):
13
- """
14
- Initialize the exception.
15
-
16
- Args:
17
- message: Custom error message
18
- code: Custom error code
19
- data: Additional error data
20
- """
21
- self.message = message or self.message
22
- self.code = code or self.code
23
- self.data = data or self.data
24
- super().__init__(self.message)
25
-
26
- def as_dict(self) -> Dict[str, Any]:
27
- """
28
- Convert the exception to a dictionary.
29
-
30
- Returns:
31
- Dict containing error details
32
- """
33
- return {
34
- "code": self.code,
35
- "message": self.message,
36
- "data": self.data
37
- }
38
-
39
- # Authentication and Authorization Exceptions
40
- class AuthenticationError(PaymentException):
41
- """Exception raised when authentication fails."""
42
- code = "authentication_error"
43
- message = "Authentication failed"
44
-
45
-
46
-
47
- class InvalidCredentials(AuthenticationError):
48
- """Exception raised when credentials are invalid."""
49
- code = "invalid_credentials"
50
- message = "Invalid credentials provided"
51
-
52
- class PermissionDenied(AuthenticationError):
53
- """Exception raised when permission is denied."""
54
- code = "permission_denied"
55
- message = "Permission denied"
56
-
57
- # Transaction Exceptions
58
- class TransactionError(PaymentException):
59
- """Base exception for transaction errors."""
60
- code = "transaction_error"
61
- message = "Transaction error occurred"
62
-
63
-
64
- class TransactionNotFound(TransactionError):
65
- """Exception raised when a transaction is not found."""
66
- code = "transaction_not_found"
67
- message = "Transaction not found"
68
-
69
- class TransactionAlreadyExists(TransactionError):
70
- """Exception raised when a transaction already exists."""
71
- code = "transaction_already_exists"
72
- message = "Transaction already exists"
73
-
74
-
75
- class TransactionCancelled(TransactionError):
76
- """Exception raised when a transaction is cancelled."""
77
- code = "transaction_cancelled"
78
- message = "Transaction has been cancelled"
79
-
80
- class TransactionInProgress(TransactionError):
81
- """Exception raised when a transaction is in progress."""
82
- code = "transaction_in_progress"
83
- message = "Transaction is in progress"
84
-
85
-
86
- class TransactionCompleted(TransactionError):
87
- """Exception raised when a transaction is already completed."""
88
- code = "transaction_completed"
89
- message = "Transaction is already completed"
90
-
91
- # Account Exceptions
92
- class AccountError(PaymentException):
93
- """Base exception for account errors."""
94
- code = "account_error"
95
- message = "Account error occurred"
96
-
97
-
98
- class AccountNotFound(AccountError):
99
- """Exception raised when an account is not found."""
100
- code = "account_not_found"
101
- message = "Account not found"
102
-
103
- class InvalidAccount(AccountError):
104
- """Exception raised when an account is invalid."""
105
- code = "invalid_account"
106
- message = "Invalid account"
107
-
108
- # Amount Exceptions
109
- class AmountError(PaymentException):
110
- """Base exception for amount errors."""
111
- code = "amount_error"
112
- message = "Amount error occurred"
113
-
114
-
115
- class InvalidAmount(AmountError):
116
- """Exception raised when an amount is invalid."""
117
- code = "invalid_amount"
118
- message = "Invalid amount"
119
-
120
- class InsufficientFunds(AmountError):
121
- """Exception raised when there are insufficient funds."""
122
- code = "insufficient_funds"
123
- message = "Insufficient funds"
124
-
125
- # Method Exceptions
126
- class MethodError(PaymentException):
127
- """Base exception for method errors."""
128
- code = "method_error"
129
- message = "Method error occurred"
130
-
131
-
132
- class MethodNotFound(MethodError):
133
- """Exception raised when a method is not found."""
134
- code = "method_not_found"
135
- message = "Method not found"
136
-
137
- class UnsupportedMethod(MethodError):
138
- """Exception raised when a method is not supported."""
139
- code = "unsupported_method"
140
- message = "Method not supported"
141
-
142
- # System Exceptions
143
- class SystemError(PaymentException):
144
- """Base exception for system errors."""
145
- code = "system_error"
146
- message = "System error occurred"
147
-
148
-
149
- class InternalServiceError(SystemError):
150
- """Exception raised when an internal service error occurs."""
151
- code = "internal_service_error"
152
- message = "Internal service error"
153
-
154
- class ExternalServiceError(SystemError):
155
- """Exception raised when an external service error occurs."""
156
- code = "external_service_error"
157
- message = "External service error"
158
-
159
-
160
- class TimeoutError(SystemError):
161
- """Exception raised when a timeout occurs."""
162
- code = "timeout_error"
163
- message = "Operation timed out"
164
-
165
- # Create a list of exceptions that should not be wrapped
166
- exception_whitelist = (
167
- PaymentException,
168
- AuthenticationError,
169
- InvalidCredentials,
170
- PermissionDenied,
171
- TransactionError,
172
- TransactionNotFound,
173
- TransactionAlreadyExists,
174
- TransactionCancelled,
175
- TransactionInProgress,
176
- TransactionCompleted,
177
- AccountError,
178
- AccountNotFound,
179
- InvalidAccount,
180
- AmountError,
181
- InvalidAmount,
182
- InsufficientFunds,
183
- MethodError,
184
- MethodNotFound,
185
- UnsupportedMethod,
186
- SystemError,
187
- InternalServiceError,
188
- ExternalServiceError,
189
- TimeoutError,
190
- )