Commit b82a3511 by Solo Group

add time pput

1 parent 556de23b
......@@ -94,8 +94,9 @@ class Doc(Transaction):
self.log_info("REQUEST {}".format(data))
try:
results = requests.post(url, json=data, headers=headers, timeout=timeout) # data=jsondata,
except Excetions as e:
except Exception as e:
print(e)
return
if results.status_code != 200:
self.log_error(results)
......@@ -185,6 +186,8 @@ class Doc(Transaction):
return self.ack_invalid_number()
data = self.get_data()
rows = self.send_rpc('inquiry', data)
if not rows:
return self.ack_inquiry_timeout()
if 'error' in rows:
code = rows['error']['code'] \
......@@ -562,7 +565,7 @@ class Doc(Transaction):
def ack_inquiry_timeout(self):
msg = ERR_INQUIRY_TIMEOUT.format(
kd_bayar=self.invoice_id['Nomor Bayar'])
self.ack_other(msg)
self.ack_timeout(msg)
def ack_already_paid(self):
msg = ERR_ALREADY_PAID.format(invoice_id=self.invoice_id_raw)
......@@ -576,7 +579,7 @@ class Doc(Transaction):
kd_bayar = self.invoice_profile['Nomor Bayar']
ntb = self.from_iso.get_ntb()
msg = ERR_PAYMENT_TIMEOUT.format(kd_bayar=kd_bayar, ntb=ntb)
self.ack_other(msg)
self.ack_timeout(msg)
def ack_payment_failed(self, result):
kd_bayar = self.invoice_profile['Nomor Bayar']
......@@ -601,7 +604,7 @@ class Doc(Transaction):
kd_bayar = self.invoice_profile['Nomor Bayar']
ntb = self.from_iso.get_ntb()
msg = ERR_REVERSAL_TIMEOUT.format(kd_bayar=kd_bayar, ntb=ntb)
self.ack_other(msg)
self.ack_timeout(msg)
def ack_reversal_failed(self, result):
kd_bayar = self.invoice_profile['Nomor Bayar']
......
......@@ -259,5 +259,8 @@ class Transaction(BaseTransaction, Log):
self.setBit(62, msg)
BaseTransaction.ack_other(self, msg)
def ack_timeout(self, msg='Biller Timeout'):
self.ack(68, msg)
def set_transaction_code(self, code):
self.setBit(3, code)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!