Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
iso8583-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 08d8a777
authored
Aug 13, 2021
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
json rpc memanggil conn.job_web_response
1 parent
f4d06669
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
33 deletions
iso8583_web/views/jsonrpc/__init__.py
iso8583_web/views/jsonrpc/__init__.py
View file @
08d8a77
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment