Commit da970dbe by Solo Group

VSI

1 parent d6a7e8e5
...@@ -98,9 +98,24 @@ class Vendor(VendorClass): ...@@ -98,9 +98,24 @@ class Vendor(VendorClass):
self.response = dict(code=result.status_code, message=result.text) self.response = dict(code=result.status_code, message=result.text)
log.info("Payment Response: %s" % (self.response)) log.info("Payment Response: %s" % (self.response))
return self.set_pending(data, message=result.text) return self.set_pending(data, message=result.text)
except requests.exceptions.HTTPError as errh:
message = "Http Error:"
self.status = -2
return self.set_pending(data, message=message)
except requests.exceptions.ConnectionError as errc:
message = "Error Connecting:"
self.status = -2
return self.set_pending(data, message=message)
except requests.exceptions.Timeout as errt:
message = "Timeout Error:"
self.status = -2
return self.set_pending(data, message=message)
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
self.status = 0 message = "Other HTTP Error"
return self.set_pending(data, message=e.strerror) self.status = -2
return self.set_pending(data, message=message)
self.amt_buy = "harga" in data and data["harga"] or self.amt_buy self.amt_buy = "harga" in data and data["harga"] or self.amt_buy
self.vend_inv_no = "ref_num" in data and data["ref_num"] or self.vend_inv_no self.vend_inv_no = "ref_num" in data and data["ref_num"] or self.vend_inv_no
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!