Commit 08d8a777 by aa.gusti

json rpc memanggil conn.job_web_response

1 parent f4d06669
...@@ -84,38 +84,39 @@ def webr_response(iso): ...@@ -84,38 +84,39 @@ def webr_response(iso):
result.update(profile.to_dict()) result.update(profile.to_dict())
return result return result
def default_response(iso): # dipindah kemasing2 module di job
d = iso_to_dict(iso) # def default_response(iso):
if d[39] == '00': # d = iso_to_dict(iso)
pass # if d[39] == '00':
elif d[39] == '55': # pass
raise JsonRpcBillNotFound() # elif d[39] == '55':
elif d[39] == '54': # raise JsonRpcBillNotFound()
raise JsonRpcBillAlreadyPaid() # elif d[39] == '54':
else: # raise JsonRpcBillAlreadyPaid()
raise JsonRpcBillerNetwork() # else:
profile = FixLength(INVOICE_PROFILE) # raise JsonRpcBillerNetwork()
profile.set_raw(d[62]) # profile = FixLength(INVOICE_PROFILE)
tgl = FixLength(TANGGAL) # profile.set_raw(d[62])
tgl.set_raw(profile['Jatuh Tempo']) # tgl = FixLength(TANGGAL)
jatuh_tempo = '-'.join([tgl['Tanggal'], tgl['Bulan'], tgl['Tahun']]) # tgl.set_raw(profile['Jatuh Tempo'])
return dict( # jatuh_tempo = '-'.join([tgl['Tanggal'], tgl['Bulan'], tgl['Tahun']])
stan=d[11], # return dict(
invoice_id=d[61], # stan=d[11],
amount=int(d[4]), # invoice_id=d[61],
# nama_wp=profile['Nama'].strip(), # amount=int(d[4]),
# alamat_op=profile['Lokasi'].strip(), # # nama_wp=profile['Nama'].strip(),
# kelurahan_op=profile['Nama Kelurahan'].strip(), # # alamat_op=profile['Lokasi'].strip(),
# kecamatan_op=profile['Nama Kecamatan'].strip(), # # kelurahan_op=profile['Nama Kelurahan'].strip(),
# provinsi_op=profile['Nama Propinsi'].strip(), # # kecamatan_op=profile['Nama Kecamatan'].strip(),
# luas_tanah=int(profile['Luas Tanah']), # # provinsi_op=profile['Nama Propinsi'].strip(),
# luas_bangunan=int(profile['Luas Bangunan']), # # luas_tanah=int(profile['Luas Tanah']),
# jatuh_tempo=jatuh_tempo, # # luas_bangunan=int(profile['Luas Bangunan']),
# tagihan=int(profile['Tagihan']), # # jatuh_tempo=jatuh_tempo,
# denda=int(profile['Denda']), # # tagihan=int(profile['Tagihan']),
# total=int(profile['Total Bayar']), # # denda=int(profile['Denda']),
# discount=int(profile['Discount'] or 0) # # total=int(profile['Total Bayar']),
) # # discount=int(profile['Discount'] or 0)
# )
class View(BaseIsoView): class View(BaseIsoView):
...@@ -191,6 +192,7 @@ class View(BaseIsoView): ...@@ -191,6 +192,7 @@ class View(BaseIsoView):
iso_resp = self.send_iso(conn, iso_req) iso_resp = self.send_iso(conn, iso_req)
#after get #after get
self.create_iso_log(iso_resp) # web_log self.create_iso_log(iso_resp) # web_log
data = conn.job.web_response(iso_resp)
# xxxx # xxxx
# from opensipkd.iso8583.bjb.pbb.structure import INQUIRY_CODE as pbb_inquiry # from opensipkd.iso8583.bjb.pbb.structure import INQUIRY_CODE as pbb_inquiry
# from opensipkd.iso8583.bjb.pbb.structure import PAYMENT_CODE as pbb_payment # from opensipkd.iso8583.bjb.pbb.structure import PAYMENT_CODE as pbb_payment
...@@ -204,7 +206,7 @@ class View(BaseIsoView): ...@@ -204,7 +206,7 @@ class View(BaseIsoView):
# else: # else:
# data = default_response(iso_resp) # data = default_response(iso_resp)
data={"stan": stan} # data={"stan": stan}
r = dict(code=0, message='OK', data=data) r = dict(code=0, message='OK', data=data)
self.log_send(r) self.log_send(r)
return r return r
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!