fix zareinpal
This commit is contained in:
@@ -110,12 +110,16 @@ class Zarinpal(BaseBank):
|
|||||||
super(Zarinpal, self).verify(transaction_code)
|
super(Zarinpal, self).verify(transaction_code)
|
||||||
data = self.get_verify_data()
|
data = self.get_verify_data()
|
||||||
client = self._get_client(timeout=10)
|
client = self._get_client(timeout=10)
|
||||||
|
try:
|
||||||
result = client.service.PaymentVerification(**data)
|
result = client.service.PaymentVerification(**data)
|
||||||
if result.Status in [100, 101]:
|
if result.Status in [100, 101]:
|
||||||
self._set_payment_status(PaymentStatus.COMPLETE)
|
self._set_payment_status(PaymentStatus.COMPLETE)
|
||||||
else:
|
else:
|
||||||
self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
|
self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
|
||||||
logging.debug("Zarinpal gateway unapprove payment")
|
logging.debug("Zarinpal gateway unapprove payment")
|
||||||
|
except:
|
||||||
|
self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
|
||||||
|
logging.debug("Zarinpal gateway unapprove payment")
|
||||||
|
|
||||||
def _get_client(self, timeout=5):
|
def _get_client(self, timeout=5):
|
||||||
transport = Transport(timeout=timeout, operation_timeout=timeout)
|
transport = Transport(timeout=timeout, operation_timeout=timeout)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ DEFAULT_FROM_EMAIL = os.getenv("SECRET_KEY")
|
|||||||
|
|
||||||
# Security and Debugging
|
# Security and Debugging
|
||||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||||
DEBUG = True
|
DEBUG = False
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@@ -244,7 +244,7 @@ AWS_S3_OBJECT_PARAMETERS = {
|
|||||||
AZ_IRANIAN_BANK_GATEWAYS = {
|
AZ_IRANIAN_BANK_GATEWAYS = {
|
||||||
"GATEWAYS": {
|
"GATEWAYS": {
|
||||||
"ZARINPAL": {
|
"ZARINPAL": {
|
||||||
"MERCHANT_CODE": "",
|
"MERCHANT_CODE": "f1d0afad-6bbc-4494-a060-555dca675a29",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"IS_SAMPLE_FORM_ENABLE": True,
|
"IS_SAMPLE_FORM_ENABLE": True,
|
||||||
|
|||||||
Reference in New Issue
Block a user