paytechuz 0.2.3__tar.gz → 0.2.5__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.

Files changed (74) hide show
  1. {paytechuz-0.2.3/src/paytechuz.egg-info → paytechuz-0.2.5}/PKG-INFO +17 -4
  2. {paytechuz-0.2.3 → paytechuz-0.2.5}/README.md +16 -3
  3. {paytechuz-0.2.3 → paytechuz-0.2.5}/pyproject.toml +1 -1
  4. {paytechuz-0.2.3 → paytechuz-0.2.5}/setup.py +1 -1
  5. {paytechuz-0.2.3/src/paytechuz → paytechuz-0.2.5/src}/core/base.py +2 -2
  6. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/click/client.py +6 -5
  7. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/payme/client.py +1 -1
  8. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/views.py +2 -2
  9. {paytechuz-0.2.3 → paytechuz-0.2.5/src/paytechuz.egg-info}/PKG-INFO +17 -4
  10. {paytechuz-0.2.3 → paytechuz-0.2.5}/MANIFEST.in +0 -0
  11. {paytechuz-0.2.3 → paytechuz-0.2.5}/setup.cfg +0 -0
  12. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/__init__.py +0 -0
  13. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/__init__.py +0 -0
  14. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/constants.py +0 -0
  15. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/exceptions.py +0 -0
  16. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/http.py +0 -0
  17. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/payme/errors.py +0 -0
  18. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/core/utils.py +0 -0
  19. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/__init__.py +0 -0
  20. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/click/__init__.py +0 -0
  21. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/click/merchant.py +0 -0
  22. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/click/webhook.py +0 -0
  23. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/payme/__init__.py +0 -0
  24. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/payme/cards.py +0 -0
  25. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/payme/receipts.py +0 -0
  26. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/gateways/payme/webhook.py +0 -0
  27. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/__init__.py +0 -0
  28. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/__init__.py +0 -0
  29. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/admin.py +0 -0
  30. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/apps.py +0 -0
  31. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/migrations/0001_initial.py +0 -0
  32. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/migrations/__init__.py +0 -0
  33. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/models.py +0 -0
  34. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/signals.py +0 -0
  35. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/views.py +0 -0
  36. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/django/webhooks.py +0 -0
  37. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/fastapi/__init__.py +0 -0
  38. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/fastapi/models.py +0 -0
  39. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/fastapi/routes.py +0 -0
  40. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/integrations/fastapi/schemas.py +0 -0
  41. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/__init__.py +0 -0
  42. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/__init__.py +0 -0
  43. {paytechuz-0.2.3/src → paytechuz-0.2.5/src/paytechuz}/core/base.py +0 -0
  44. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/constants.py +0 -0
  45. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/exceptions.py +0 -0
  46. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/http.py +0 -0
  47. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/payme/errors.py +0 -0
  48. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/core/utils.py +0 -0
  49. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/__init__.py +0 -0
  50. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/click/__init__.py +0 -0
  51. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/click/client.py +0 -0
  52. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/click/merchant.py +0 -0
  53. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/click/webhook.py +0 -0
  54. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/payme/__init__.py +0 -0
  55. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/payme/cards.py +0 -0
  56. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/payme/client.py +0 -0
  57. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/payme/receipts.py +0 -0
  58. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/gateways/payme/webhook.py +0 -0
  59. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/__init__.py +0 -0
  60. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/__init__.py +0 -0
  61. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/admin.py +0 -0
  62. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/apps.py +0 -0
  63. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/migrations/0001_initial.py +0 -0
  64. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/migrations/__init__.py +0 -0
  65. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/models.py +0 -0
  66. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/signals.py +0 -0
  67. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/django/webhooks.py +0 -0
  68. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/fastapi/__init__.py +0 -0
  69. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/fastapi/models.py +0 -0
  70. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/fastapi/routes.py +0 -0
  71. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz/integrations/fastapi/schemas.py +0 -0
  72. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz.egg-info/SOURCES.txt +0 -0
  73. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz.egg-info/dependency_links.txt +0 -0
  74. {paytechuz-0.2.3 → paytechuz-0.2.5}/src/paytechuz.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.2.3
3
+ Version: 0.2.5
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
@@ -66,8 +66,8 @@ payme_link = payme.create_payment(
66
66
  )
67
67
 
68
68
  click_link = click.create_payment(
69
+ id="order_123",
69
70
  amount=150000, # amount in UZS
70
- account_id="order_123",
71
71
  description="Test payment",
72
72
  return_url="https://example.com/return"
73
73
  )
@@ -102,10 +102,10 @@ CLICK_COMMISSION_PERCENT = 0.0
102
102
 
103
103
  ```python
104
104
  # views.py
105
- from paytechuz.integrations.django.views import PaymeWebhookView
105
+ from paytechuz.integrations.django.views import BasePaymeWebhookView
106
106
  from .models import Order
107
107
 
108
- class PaymeWebhookView(PaymeWebhookView):
108
+ class PaymeWebhookView(BasePaymeWebhookView):
109
109
  def successfully_payment(self, params, transaction):
110
110
  order = Order.objects.get(id=transaction.account_id)
111
111
  order.status = 'paid'
@@ -117,6 +117,19 @@ class PaymeWebhookView(PaymeWebhookView):
117
117
  order.save()
118
118
  ```
119
119
 
120
+ 3. Add webhook URLs to `urls.py`:
121
+
122
+ ```python
123
+ # urls.py
124
+ from django.urls import path
125
+ from .views import PaymeWebhookView
126
+
127
+ urlpatterns = [
128
+ # ...
129
+ path('payments/webhook/payme/', PaymeWebhookView.as_view(), name='payme_webhook'),
130
+ ]
131
+ ```
132
+
120
133
  ### FastAPI Integration
121
134
 
122
135
  1. Create webhook handler:
@@ -51,8 +51,8 @@ payme_link = payme.create_payment(
51
51
  )
52
52
 
53
53
  click_link = click.create_payment(
54
+ id="order_123",
54
55
  amount=150000, # amount in UZS
55
- account_id="order_123",
56
56
  description="Test payment",
57
57
  return_url="https://example.com/return"
58
58
  )
@@ -87,10 +87,10 @@ CLICK_COMMISSION_PERCENT = 0.0
87
87
 
88
88
  ```python
89
89
  # views.py
90
- from paytechuz.integrations.django.views import PaymeWebhookView
90
+ from paytechuz.integrations.django.views import BasePaymeWebhookView
91
91
  from .models import Order
92
92
 
93
- class PaymeWebhookView(PaymeWebhookView):
93
+ class PaymeWebhookView(BasePaymeWebhookView):
94
94
  def successfully_payment(self, params, transaction):
95
95
  order = Order.objects.get(id=transaction.account_id)
96
96
  order.status = 'paid'
@@ -102,6 +102,19 @@ class PaymeWebhookView(PaymeWebhookView):
102
102
  order.save()
103
103
  ```
104
104
 
105
+ 3. Add webhook URLs to `urls.py`:
106
+
107
+ ```python
108
+ # urls.py
109
+ from django.urls import path
110
+ from .views import PaymeWebhookView
111
+
112
+ urlpatterns = [
113
+ # ...
114
+ path('payments/webhook/payme/', PaymeWebhookView.as_view(), name='payme_webhook'),
115
+ ]
116
+ ```
117
+
105
118
  ### FastAPI Integration
106
119
 
107
120
  1. Create webhook handler:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "paytechuz"
7
- version = "0.2.3"
7
+ version = "0.2.5"
8
8
  description = "Unified Python package for Uzbekistan payment gateways"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
@@ -8,7 +8,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
8
8
 
9
9
  setup(
10
10
  name='paytechuz',
11
- version='0.2.3',
11
+ version='0.2.5',
12
12
  license='MIT',
13
13
  author="Muhammadali Akbarov",
14
14
  author_email='muhammadali17abc@gmail.com',
@@ -26,16 +26,16 @@ class BasePaymentGateway(ABC):
26
26
  @abstractmethod
27
27
  def create_payment(
28
28
  self,
29
+ id: Union[int, str],
29
30
  amount: Union[int, float, str],
30
- account_id: Union[int, str],
31
31
  **kwargs
32
32
  ) -> Dict[str, Any]:
33
33
  """
34
34
  Create a payment.
35
35
 
36
36
  Args:
37
+ id: The account ID or order ID
37
38
  amount: The payment amount
38
- account_id: The account ID or order ID
39
39
  **kwargs: Additional parameters specific to the payment gateway
40
40
 
41
41
  Returns:
@@ -12,6 +12,7 @@ from paytechuz.gateways.click.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.
@@ -61,16 +62,16 @@ class ClickGateway(BasePaymentGateway):
61
62
  @handle_exceptions
62
63
  def create_payment(
63
64
  self,
65
+ id: Union[int, str],
64
66
  amount: Union[int, float, str],
65
- account_id: Union[int, str],
66
67
  **kwargs
67
68
  ) -> Dict[str, Any]:
68
69
  """
69
70
  Create a payment using Click.
70
71
 
71
72
  Args:
73
+ id: The account ID or order ID
72
74
  amount: The payment amount in som
73
- account_id: The account ID or order ID
74
75
  **kwargs: Additional parameters for the payment
75
76
  - description: Payment description
76
77
  - return_url: URL to return after payment
@@ -99,7 +100,7 @@ class ClickGateway(BasePaymentGateway):
99
100
  payment_url += f"?service_id={self.service_id}"
100
101
  payment_url += f"&merchant_id={self.merchant_id}"
101
102
  payment_url += f"&amount={amount}"
102
- payment_url += f"&transaction_param={account_id}"
103
+ payment_url += f"&transaction_param={id}"
103
104
 
104
105
  if return_url:
105
106
  payment_url += f"&return_url={return_url}"
@@ -111,13 +112,13 @@ class ClickGateway(BasePaymentGateway):
111
112
  payment_url += f"&merchant_user_id={description}"
112
113
 
113
114
  # Generate a unique transaction ID
114
- transaction_id = f"click_{account_id}_{int(amount_tiyin)}"
115
+ transaction_id = f"click_{id}_{int(amount_tiyin)}"
115
116
 
116
117
  return {
117
118
  'transaction_id': transaction_id,
118
119
  'payment_url': payment_url,
119
120
  'amount': amount,
120
- 'account_id': account_id,
121
+ 'account_id': id,
121
122
  'status': 'created',
122
123
  'service_id': self.service_id,
123
124
  'merchant_id': self.merchant_id
@@ -149,8 +149,8 @@ class PaymeGateway(BasePaymentGateway):
149
149
  Create a payment using Payme.
150
150
 
151
151
  Args:
152
+ id: Account or order ID
152
153
  amount: Payment amount in som
153
- account_id: Account or order ID
154
154
  return_url: Return URL after payment (default: "")
155
155
  account_field_name: Field name for account ID (default: "order_id")
156
156
 
@@ -10,7 +10,7 @@ from .webhooks import PaymeWebhook, ClickWebhook
10
10
  logger = logging.getLogger(__name__)
11
11
 
12
12
  @method_decorator(csrf_exempt, name='dispatch')
13
- class PaymeWebhookView(PaymeWebhook):
13
+ class BasePaymeWebhookView(PaymeWebhook):
14
14
  """
15
15
  Default Payme webhook view.
16
16
 
@@ -55,7 +55,7 @@ class PaymeWebhookView(PaymeWebhook):
55
55
  logger.info(f"Payme payment cancelled: {transaction.transaction_id}")
56
56
 
57
57
  @method_decorator(csrf_exempt, name='dispatch')
58
- class ClickWebhookView(ClickWebhook):
58
+ class BaseClickWebhookView(ClickWebhook):
59
59
  """
60
60
  Default Click webhook view.
61
61
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: paytechuz
3
- Version: 0.2.3
3
+ Version: 0.2.5
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
@@ -66,8 +66,8 @@ payme_link = payme.create_payment(
66
66
  )
67
67
 
68
68
  click_link = click.create_payment(
69
+ id="order_123",
69
70
  amount=150000, # amount in UZS
70
- account_id="order_123",
71
71
  description="Test payment",
72
72
  return_url="https://example.com/return"
73
73
  )
@@ -102,10 +102,10 @@ CLICK_COMMISSION_PERCENT = 0.0
102
102
 
103
103
  ```python
104
104
  # views.py
105
- from paytechuz.integrations.django.views import PaymeWebhookView
105
+ from paytechuz.integrations.django.views import BasePaymeWebhookView
106
106
  from .models import Order
107
107
 
108
- class PaymeWebhookView(PaymeWebhookView):
108
+ class PaymeWebhookView(BasePaymeWebhookView):
109
109
  def successfully_payment(self, params, transaction):
110
110
  order = Order.objects.get(id=transaction.account_id)
111
111
  order.status = 'paid'
@@ -117,6 +117,19 @@ class PaymeWebhookView(PaymeWebhookView):
117
117
  order.save()
118
118
  ```
119
119
 
120
+ 3. Add webhook URLs to `urls.py`:
121
+
122
+ ```python
123
+ # urls.py
124
+ from django.urls import path
125
+ from .views import PaymeWebhookView
126
+
127
+ urlpatterns = [
128
+ # ...
129
+ path('payments/webhook/payme/', PaymeWebhookView.as_view(), name='payme_webhook'),
130
+ ]
131
+ ```
132
+
120
133
  ### FastAPI Integration
121
134
 
122
135
  1. Create webhook handler:
File without changes
File without changes
File without changes
File without changes
File without changes