paytechuz 0.3.1__py3-none-any.whl → 0.3.3__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 +1 -1
- paytechuz/integrations/django/models.py +6 -0
- paytechuz/integrations/django/webhooks.py +6 -2
- {paytechuz-0.3.1.dist-info → paytechuz-0.3.3.dist-info}/METADATA +1 -1
- {paytechuz-0.3.1.dist-info → paytechuz-0.3.3.dist-info}/RECORD +7 -7
- {paytechuz-0.3.1.dist-info → paytechuz-0.3.3.dist-info}/WHEEL +0 -0
- {paytechuz-0.3.1.dist-info → paytechuz-0.3.3.dist-info}/top_level.txt +0 -0
paytechuz/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ This library provides a unified interface for working with Payme, Click, and Atm
|
|
|
5
5
|
payment systems in Uzbekistan. It supports Django, Flask, and FastAPI.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = '0.3.
|
|
8
|
+
__version__ = '0.3.2'
|
|
9
9
|
|
|
10
10
|
# Import framework integrations - these imports are used to check availability
|
|
11
11
|
# of frameworks, not for direct usage
|
|
@@ -73,6 +73,12 @@ class PaymentTransaction(models.Model):
|
|
|
73
73
|
self.save()
|
|
74
74
|
return self
|
|
75
75
|
|
|
76
|
+
def mark_as_cancelled_during_init(self, reason):
|
|
77
|
+
self.state = self.CANCELLED_DURING_INIT
|
|
78
|
+
self.cancelled_at = timezone.now()
|
|
79
|
+
self.reason = reason
|
|
80
|
+
self.save()
|
|
81
|
+
|
|
76
82
|
def mark_as_cancelled(self, reason=None):
|
|
77
83
|
"""
|
|
78
84
|
Mark the transaction as cancelled.
|
|
@@ -439,8 +439,12 @@ class PaymeWebhook(View):
|
|
|
439
439
|
# If transaction is already cancelled, return the existing data
|
|
440
440
|
return self._cancel_response(transaction)
|
|
441
441
|
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
if transaction.state == PaymentTransaction.INITIATING:
|
|
443
|
+
transaction.mark_as_cancelled_during_init(reason=reason)
|
|
444
|
+
|
|
445
|
+
else:
|
|
446
|
+
# Use the mark_as_cancelled method to properly store the reason
|
|
447
|
+
transaction.mark_as_cancelled(reason=reason)
|
|
444
448
|
|
|
445
449
|
# Call the event method
|
|
446
450
|
self.cancelled_payment(params, transaction)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
paytechuz/__init__.py,sha256=
|
|
1
|
+
paytechuz/__init__.py,sha256=uWgnlJCeEyLr6Nl54y8yVKo0nzvzjsJ6nfwcc1Kdbx8,1916
|
|
2
2
|
paytechuz/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
paytechuz/core/base.py,sha256=Es6eEGNgDjQJe-kEJVAHSAh8AWbgtIuQMm0xn7qfjl4,2549
|
|
4
4
|
paytechuz/core/constants.py,sha256=hzCy5Kc8HVSDhXxNgObbJ2e9SYcXTYL3qky_q0tlpHU,2305
|
|
@@ -23,10 +23,10 @@ paytechuz/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
23
23
|
paytechuz/integrations/django/__init__.py,sha256=fNs4c2IWpCe78-_Yvgz59TdKbHiYRYDkLR33QOBf-Ok,356
|
|
24
24
|
paytechuz/integrations/django/admin.py,sha256=6fs6GiKcdc-hGlLxJ0BthY7TFo_2RVVJRhQwhxMroCY,2664
|
|
25
25
|
paytechuz/integrations/django/apps.py,sha256=Q9wG2osL7_Ip2BcAkq7lmmhu4UKJAg6UtSsSq_RgHlc,640
|
|
26
|
-
paytechuz/integrations/django/models.py,sha256=
|
|
26
|
+
paytechuz/integrations/django/models.py,sha256=ze-yzGBYN3sAXFClT6xjEzRN3ihepPVPDcm_qgdvM40,5936
|
|
27
27
|
paytechuz/integrations/django/signals.py,sha256=VtNYEAnu13wi9PqadEaCU9LY_k2tY26AS4bnPIAqw7M,1319
|
|
28
28
|
paytechuz/integrations/django/views.py,sha256=KFiuMcr4BtMbzbrW_RbIkv0-Fk214WIWWwaStscArzs,4149
|
|
29
|
-
paytechuz/integrations/django/webhooks.py,sha256=
|
|
29
|
+
paytechuz/integrations/django/webhooks.py,sha256=_1nipbMIFc_Q4LijNB2byu5aKMrQmpMkJt_eFAWvFPw,36801
|
|
30
30
|
paytechuz/integrations/django/migrations/0001_initial.py,sha256=SWHIUuwq91crzaxa9v1UK0kay8CxsjUo6t4bqg7j0Gw,1896
|
|
31
31
|
paytechuz/integrations/django/migrations/0002_alter_paymenttransaction_gateway.py,sha256=XiZx5urgfhXxra3W_KWksQ1LbaDOs3sjPn4w0T2cW50,457
|
|
32
32
|
paytechuz/integrations/django/migrations/__init__.py,sha256=KLQ5NdjOMLDS21-u3b_g08G1MjPMMhG95XI_N8m4FSo,41
|
|
@@ -34,7 +34,7 @@ paytechuz/integrations/fastapi/__init__.py,sha256=DLnhAZQZf2ghu8BuFFfE7FzbNKWQQ2
|
|
|
34
34
|
paytechuz/integrations/fastapi/models.py,sha256=9IqrsndIVuIDwDbijZ89biJxEWQASXRBfWVShxgerAc,5113
|
|
35
35
|
paytechuz/integrations/fastapi/routes.py,sha256=t8zbqhMZsaJmEvMDgmF-NoRmbqksfX_AvIrx-3kCjg8,37845
|
|
36
36
|
paytechuz/integrations/fastapi/schemas.py,sha256=PgRqviJiD4-u3_CIkUOX8R7L8Yqn8L44WLte7968G0E,3887
|
|
37
|
-
paytechuz-0.3.
|
|
38
|
-
paytechuz-0.3.
|
|
39
|
-
paytechuz-0.3.
|
|
40
|
-
paytechuz-0.3.
|
|
37
|
+
paytechuz-0.3.3.dist-info/METADATA,sha256=HxBgF8UNDby8T-ladhLbeT5PCz2WqaoFSncS8frdt9Q,13096
|
|
38
|
+
paytechuz-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
39
|
+
paytechuz-0.3.3.dist-info/top_level.txt,sha256=oloyKGNVj9Z2h3wpKG5yPyTlpdpWW0-CWr-j-asCWBc,10
|
|
40
|
+
paytechuz-0.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|