payme-pkg 3.0.21__tar.gz → 3.0.23__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 payme-pkg might be problematic. Click here for more details.

Files changed (37) hide show
  1. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/PKG-INFO +1 -7
  2. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/README.md +0 -6
  3. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/exceptions/webhook.py +33 -1
  4. payme_pkg-3.0.23/payme/migrations/0002_paymetransactions_fiscal_data.py +18 -0
  5. payme_pkg-3.0.23/payme/migrations/0003_alter_paymetransactions_fiscal_data.py +18 -0
  6. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/models.py +1 -0
  7. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/response/webhook.py +8 -0
  8. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/views.py +28 -0
  9. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme_pkg.egg-info/PKG-INFO +1 -7
  10. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme_pkg.egg-info/SOURCES.txt +2 -0
  11. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/setup.py +1 -1
  12. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/LICENSE.txt +0 -0
  13. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/__init__.py +0 -0
  14. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/admin.py +0 -0
  15. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/apps.py +0 -0
  16. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/__init__.py +0 -0
  17. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/cards.py +0 -0
  18. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/client.py +0 -0
  19. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/http.py +0 -0
  20. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/initializer.py +0 -0
  21. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/classes/receipts.py +0 -0
  22. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/const.py +0 -0
  23. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/exceptions/__init__.py +0 -0
  24. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/exceptions/general.py +0 -0
  25. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/migrations/0001_initial.py +0 -0
  26. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/migrations/__init__.py +0 -0
  27. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/__init__.py +0 -0
  28. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/request/__init__.py +0 -0
  29. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/response/__init__.py +0 -0
  30. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/response/cards.py +0 -0
  31. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/types/response/receipts.py +0 -0
  32. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/urls.py +0 -0
  33. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme/util.py +0 -0
  34. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme_pkg.egg-info/dependency_links.txt +0 -0
  35. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme_pkg.egg-info/requires.txt +0 -0
  36. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/payme_pkg.egg-info/top_level.txt +0 -0
  37. {payme_pkg-3.0.21 → payme_pkg-3.0.23}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.21
3
+ Version: 3.0.23
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -39,12 +39,6 @@ Requires-Dist: djangorestframework==3.*
39
39
  <p align="center">Visit the full documentation for Merchant and Subscribe API</p>
40
40
  </a>
41
41
 
42
- <a href="https://youtu.be/xxiIggu_RNk?si=Idpg8omFvFDCYtcm" target="_blank">
43
- <p align="center">
44
- <img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif" alt="Payme PKG Demo">
45
- </p>
46
- </a>
47
-
48
42
  <p align="center">
49
43
  <a href="https://youtu.be/7q7-c72tHpc?si=Sr0EAmEawWAFRk1m" target="_blank">
50
44
  <img src="https://img.shields.io/badge/Watch%20Demo-red?logo=youtube&logoColor=white&style=for-the-badge"
@@ -25,12 +25,6 @@
25
25
  <p align="center">Visit the full documentation for Merchant and Subscribe API</p>
26
26
  </a>
27
27
 
28
- <a href="https://youtu.be/xxiIggu_RNk?si=Idpg8omFvFDCYtcm" target="_blank">
29
- <p align="center">
30
- <img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif" alt="Payme PKG Demo">
31
- </p>
32
- </a>
33
-
34
28
  <p align="center">
35
29
  <a href="https://youtu.be/7q7-c72tHpc?si=Sr0EAmEawWAFRk1m" target="_blank">
36
30
  <img src="https://img.shields.io/badge/Watch%20Demo-red?logo=youtube&logoColor=white&style=for-the-badge"
@@ -116,10 +116,42 @@ class TransactionAlreadyExists(BasePaymeException):
116
116
  }
117
117
 
118
118
 
119
+ class InvalidFiscalParams(BasePaymeException):
120
+ """
121
+ InvalidFiscalParams APIException.
122
+
123
+ Raised when the provided fiscal parameters are invalid.
124
+ """
125
+ status_code = 200
126
+ error_code = -32602
127
+ message = {
128
+ "uz": "Fiskal parameterlarida kamchiliklar bor",
129
+ "ru": "Неверные фискальные параметры.",
130
+ "en": "Invalid fiscal parameters."
131
+ }
132
+
133
+
134
+ class InvalidAccount(BasePaymeException):
135
+ """
136
+ InvalidAccount APIException.
137
+
138
+ Raised when the provided account is invalid.
139
+ """
140
+ status_code = 200
141
+ error_code = -32400
142
+ message = {
143
+ "uz": "Hisob nomida kamchilik bor",
144
+ "ru": "Неверный номер счета.",
145
+ "en": "Invalid account."
146
+ }
147
+
148
+
119
149
  exception_whitelist = (
120
150
  IncorrectAmount,
121
151
  MethodNotFound,
122
152
  PermissionDenied,
123
153
  AccountDoesNotExist,
124
- TransactionAlreadyExists
154
+ TransactionAlreadyExists,
155
+ InvalidFiscalParams,
156
+ InvalidAccount
125
157
  )
@@ -0,0 +1,18 @@
1
+ # Generated by Django 5.1.2 on 2025-03-14 08:01
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("payme", "0001_initial"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name="paymetransactions",
15
+ name="fiscal_data",
16
+ field=models.JSONField(blank=True, null=True),
17
+ ),
18
+ ]
@@ -0,0 +1,18 @@
1
+ # Generated by Django 5.1.2 on 2025-03-14 08:20
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ("payme", "0002_paymetransactions_fiscal_data"),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name="paymetransactions",
15
+ name="fiscal_data",
16
+ field=models.JSONField(default=dict),
17
+ ),
18
+ ]
@@ -29,6 +29,7 @@ class PaymeTransactions(models.Model):
29
29
  account_id = models.BigIntegerField(null=False)
30
30
  amount = models.DecimalField(max_digits=10, decimal_places=2)
31
31
  state = models.IntegerField(choices=STATE, default=CREATED)
32
+ fiscal_data = models.JSONField(default=dict)
32
33
  cancel_reason = models.IntegerField(null=True, blank=True)
33
34
  created_at = models.DateTimeField(auto_now_add=True, db_index=True)
34
35
  updated_at = models.DateTimeField(auto_now=True, db_index=True)
@@ -134,3 +134,11 @@ class GetStatement(CommonResponse):
134
134
  The check perform transactions response
135
135
  """
136
136
  transactions: List[str]
137
+
138
+
139
+ @dataclass
140
+ class SetFiscalData(CommonResponse):
141
+ """
142
+ The set fiscal data request
143
+ """
144
+ success: bool
@@ -66,6 +66,7 @@ class PaymeWebHookAPIView(views.APIView):
66
66
  "CreateTransaction": self.create_transaction,
67
67
  "CheckTransaction": self.check_transaction,
68
68
  "CheckPerformTransaction": self.check_perform_transaction,
69
+ "SetFiscalData": self.set_fiscal_data,
69
70
  }
70
71
 
71
72
  try:
@@ -300,6 +301,33 @@ class PaymeWebHookAPIView(views.APIView):
300
301
 
301
302
  return result.as_resp()
302
303
 
304
+ @handle_exceptions
305
+ def set_fiscal_data(self, params):
306
+ """
307
+ Set fiscal data for the given transaction.
308
+ """
309
+ transaction = PaymeTransactions.get_by_transaction_id(transaction_id=params["id"])
310
+
311
+ fiscal_data = params.get("fiscal_data")
312
+ if not fiscal_data:
313
+ raise exceptions.InvalidFiscalParams(
314
+ "Missing fiscal_data field in parameters."
315
+ )
316
+
317
+ fiscal_type = params.get("type")
318
+
319
+ if fiscal_type not in ("PERFORM", "CANCEL"):
320
+ raise exceptions.InvalidFiscalParams(
321
+ f"Invalid fiscal type. Expected 'PERFORM' or 'CANCEL', got: {fiscal_type}"
322
+ )
323
+
324
+ fiscal_data["type"] = fiscal_type
325
+ transaction.fiscal_data = fiscal_data
326
+ transaction.save()
327
+
328
+ result = response.SetFiscalData(success=True)
329
+ return result.as_resp()
330
+
303
331
  def _cancel_response(self, transaction):
304
332
  """
305
333
  Helper method to generate cancel transaction response.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.21
3
+ Version: 3.0.23
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -39,12 +39,6 @@ Requires-Dist: djangorestframework==3.*
39
39
  <p align="center">Visit the full documentation for Merchant and Subscribe API</p>
40
40
  </a>
41
41
 
42
- <a href="https://youtu.be/xxiIggu_RNk?si=Idpg8omFvFDCYtcm" target="_blank">
43
- <p align="center">
44
- <img style="width: 60%;" src="https://i.postimg.cc/WbD32bHC/payme-pkg-demo-m4a.gif" alt="Payme PKG Demo">
45
- </p>
46
- </a>
47
-
48
42
  <p align="center">
49
43
  <a href="https://youtu.be/7q7-c72tHpc?si=Sr0EAmEawWAFRk1m" target="_blank">
50
44
  <img src="https://img.shields.io/badge/Watch%20Demo-red?logo=youtube&logoColor=white&style=for-the-badge"
@@ -20,6 +20,8 @@ payme/exceptions/__init__.py
20
20
  payme/exceptions/general.py
21
21
  payme/exceptions/webhook.py
22
22
  payme/migrations/0001_initial.py
23
+ payme/migrations/0002_paymetransactions_fiscal_data.py
24
+ payme/migrations/0003_alter_paymetransactions_fiscal_data.py
23
25
  payme/migrations/__init__.py
24
26
  payme/types/__init__.py
25
27
  payme/types/request/__init__.py
@@ -8,7 +8,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
8
8
 
9
9
  setup(
10
10
  name='payme-pkg',
11
- version='3.0.21',
11
+ version='3.0.23',
12
12
  license='MIT',
13
13
  author="Muhammadali Akbarov",
14
14
  author_email='muhammadali17abc@gmail.com',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes