Commit 08d8a777 by aa.gusti

json rpc memanggil conn.job_web_response

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