paytechuz 0.2.7__tar.gz → 0.2.8b0__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.
- {paytechuz-0.2.7/src/paytechuz.egg-info → paytechuz-0.2.8b0}/PKG-INFO +1 -1
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/pyproject.toml +1 -1
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/setup.py +1 -1
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/fastapi/models.py +9 -3
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/fastapi/routes.py +7 -3
- {paytechuz-0.2.7 → paytechuz-0.2.8b0/src/paytechuz.egg-info}/PKG-INFO +1 -1
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/MANIFEST.in +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/README.md +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/setup.cfg +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/base.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/constants.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/exceptions.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/http.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/payme/errors.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/core/utils.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/click/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/click/client.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/click/merchant.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/click/webhook.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/payme/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/payme/cards.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/payme/client.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/payme/receipts.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/gateways/payme/webhook.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/admin.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/apps.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/migrations/0001_initial.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/migrations/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/models.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/signals.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/views.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/django/webhooks.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/fastapi/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/fastapi/models.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/fastapi/routes.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/integrations/fastapi/schemas.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/base.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/constants.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/exceptions.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/http.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/payme/errors.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/core/utils.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/click/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/click/client.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/click/merchant.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/click/webhook.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/payme/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/payme/cards.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/payme/client.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/payme/receipts.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/gateways/payme/webhook.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/admin.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/apps.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/migrations/0001_initial.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/migrations/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/models.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/signals.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/views.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/webhooks.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/fastapi/__init__.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/fastapi/schemas.py +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz.egg-info/SOURCES.txt +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz.egg-info/dependency_links.txt +0 -0
- {paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz.egg-info/top_level.txt +0 -0
|
@@ -132,9 +132,15 @@ class PaymentTransaction(Base):
|
|
|
132
132
|
|
|
133
133
|
# Only update state if not already cancelled
|
|
134
134
|
if self.state not in [self.CANCELLED, self.CANCELLED_DURING_INIT]:
|
|
135
|
-
#
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
# Set state based on current state and reason
|
|
136
|
+
if self.state == self.INITIATING or reason_code == 3:
|
|
137
|
+
# If transaction is in INITIATING state or reason is 3 (execution error),
|
|
138
|
+
# set state to CANCELLED_DURING_INIT (-1)
|
|
139
|
+
self.state = self.CANCELLED_DURING_INIT
|
|
140
|
+
else:
|
|
141
|
+
# Otherwise, set state to CANCELLED (-2)
|
|
142
|
+
self.state = self.CANCELLED
|
|
143
|
+
|
|
138
144
|
self.cancelled_at = datetime.utcnow()
|
|
139
145
|
|
|
140
146
|
# Store the reason directly in the reason column
|
|
@@ -362,10 +362,14 @@ class PaymeWebhookHandler:
|
|
|
362
362
|
PaymentTransaction.transaction_id != transaction_id
|
|
363
363
|
).all()
|
|
364
364
|
|
|
365
|
-
# Filter out transactions in final states (SUCCESSFULLY, CANCELLED)
|
|
365
|
+
# Filter out transactions in final states (SUCCESSFULLY, CANCELLED, CANCELLED_DURING_INIT)
|
|
366
366
|
non_final_transactions = [
|
|
367
367
|
t for t in existing_transactions
|
|
368
|
-
if t.state not in [
|
|
368
|
+
if t.state not in [
|
|
369
|
+
PaymentTransaction.SUCCESSFULLY,
|
|
370
|
+
PaymentTransaction.CANCELLED,
|
|
371
|
+
PaymentTransaction.CANCELLED_DURING_INIT
|
|
372
|
+
]
|
|
369
373
|
]
|
|
370
374
|
|
|
371
375
|
if non_final_transactions:
|
|
@@ -534,7 +538,7 @@ class PaymeWebhookHandler:
|
|
|
534
538
|
)
|
|
535
539
|
|
|
536
540
|
# Check if transaction is already cancelled
|
|
537
|
-
if transaction.state
|
|
541
|
+
if transaction.state in [PaymentTransaction.CANCELLED, PaymentTransaction.CANCELLED_DURING_INIT]:
|
|
538
542
|
# If transaction is already cancelled, update the reason if provided
|
|
539
543
|
if 'reason' in params:
|
|
540
544
|
reason = params.get('reason')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/migrations/0001_initial.py
RENAMED
|
File without changes
|
{paytechuz-0.2.7 → paytechuz-0.2.8b0}/src/paytechuz/integrations/django/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|