fix zareinpal
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ DEFAULT_FROM_EMAIL = os.getenv("SECRET_KEY")
|
||||
|
||||
# Security and Debugging
|
||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
|
||||
# ==============================================================================
|
||||
@@ -244,7 +244,7 @@ AWS_S3_OBJECT_PARAMETERS = {
|
||||
AZ_IRANIAN_BANK_GATEWAYS = {
|
||||
"GATEWAYS": {
|
||||
"ZARINPAL": {
|
||||
"MERCHANT_CODE": "",
|
||||
"MERCHANT_CODE": "f1d0afad-6bbc-4494-a060-555dca675a29",
|
||||
}
|
||||
},
|
||||
"IS_SAMPLE_FORM_ENABLE": True,
|
||||
|
||||
Reference in New Issue
Block a user