fix zareinpal

This commit is contained in:
Parsa Nazer
2026-05-16 21:09:14 +03:30
parent 63c204cf09
commit a6998d10d4
2 changed files with 10 additions and 6 deletions
+8 -4
View File
@@ -110,10 +110,14 @@ class Zarinpal(BaseBank):
super(Zarinpal, self).verify(transaction_code)
data = self.get_verify_data()
client = self._get_client(timeout=10)
result = client.service.PaymentVerification(**data)
if result.Status in [100, 101]:
self._set_payment_status(PaymentStatus.COMPLETE)
else:
try:
result = client.service.PaymentVerification(**data)
if result.Status in [100, 101]:
self._set_payment_status(PaymentStatus.COMPLETE)
else:
self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
logging.debug("Zarinpal gateway unapprove payment")
except:
self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
logging.debug("Zarinpal gateway unapprove payment")