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 e1aed41f
authored
Jan 16, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Log yang lebih baik
1 parent
b3ee2454
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
12 deletions
CHANGES.txt
README.rst
iso8583_web/scripts/forwarder.py
CHANGES.txt
View file @
e1aed41
0.1.3 2020-01-16
----------------
- Log yang lebih baik
0.1.2 2019-07-10
----------------
- Web server berhasil dihentikan.
...
...
README.rst
View file @
e1aed41
...
...
@@ -10,21 +10,22 @@ Pemasangan
Buat Python virtual environment::
$ python3 -m venv env
$ python3 -m venv
~/
env
Awali dengan memasang paket `ebcdic <https://pypi.org/project/ebcdic/>`_
yang dibutuhkan `ISO8583 <https://pypi.org/project/ISO8583/>`_::
$ env/bin/pip install ebcdic
$
~/
env/bin/pip install ebcdic
Pemasangan yang tidak otomatis ini agar tidak menimbulkan kegagalan. Lanjut::
$ env/bin/pip install -e 'iso8583-web[testing]'
$ git clone https://git.opensipkd.com/sugiana/iso8583-web
$ ~/env/bin/pip install -e 'iso8583-web[testing]'
Saatnya mencoba::
$ cd iso8583-web
$
..
/env/bin/pytest iso8583_web/test-conf.py
$
~
/env/bin/pytest iso8583_web/test-conf.py
Pastikan tidak ada pesan ``failure``. Bila ada ``warning`` abaikan saja. Kini
salinlah file konfigurasi::
...
...
@@ -34,12 +35,9 @@ salinlah file konfigurasi::
Sesuaikan isi section ``[host_bjb]``. Anda bisa menambahkan host lainnya
dengan menambahkan awalan ``host_`` pada section.
sugiana@mi ~/opensipkd/iso8583-web $ ../env/bin/pip install
git+https://git.opensipkd.com/sugiana/opensipkd-iso8583-bjb
Jalankan daemon-nya, anggap sebagai pemda (biller)::
$
..
/env/bin/iso8583 test-pemda.ini
$
~
/env/bin/iso8583 test-pemda.ini
Anda akan mendapat pesan seperti ini::
...
...
iso8583_web/scripts/forwarder.py
View file @
e1aed41
...
...
@@ -94,6 +94,10 @@ class Log:
msg
=
exception_message
()
self
.
log_error
(
msg
)
def
log_ack
(
self
,
iso
):
if
iso
.
ack_message
:
self
.
log_error
(
iso
.
ack_message
)
def
log_decode
(
self
,
iso
):
data
=
iso_to_dict
(
iso
)
self
.
log_info
(
'Decode MTI {} Data {}'
.
format
(
iso
.
getMTI
(),
data
))
...
...
@@ -132,6 +136,7 @@ class CommonConnection(Log):
self
.
log_info
(
'ISO8583 to raw {}'
.
format
([
raw
]))
def
process
(
self
,
raw
):
self
.
log_raw_to_iso
(
raw
)
parser
=
Parser
(
self
,
raw
)
thread
=
create_thread
(
parser
.
run
)
parser_threads
.
append
((
parser
,
thread
))
...
...
@@ -329,6 +334,7 @@ class Parser(Log):
self
.
log_decode
(
from_iso
)
iso
=
self
.
connection
.
job
.
process
(
from_iso
)
if
iso
:
self
.
log_ack
(
iso
)
self
.
log_encode
(
iso
)
raw
=
iso
.
getRawIso
()
self
.
connection
.
send
(
raw
)
...
...
@@ -486,16 +492,22 @@ def inquiry(request, p):
@jsonrpc_method
(
endpoint
=
'rpc'
)
def
payment
(
request
,
p
):
log_web_receive
(
request
,
'payment'
,
p
)
conn
=
validate_rpc
(
p
)
iso
=
conn
.
job
.
payment
(
p
)
return
web_job
(
conn
,
iso
)
r
=
web_job
(
conn
,
iso
)
log_web_send
(
request
,
'payment'
,
r
)
return
r
@jsonrpc_method
(
endpoint
=
'rpc'
)
def
reversal
(
request
,
p
):
log_web_receive
(
request
,
'reversal'
,
p
)
conn
=
validate_rpc
(
p
)
iso
=
conn
.
job
.
reversal
(
p
)
return
web_job
(
conn
,
iso
)
r
=
web_job
(
conn
,
iso
)
log_web_send
(
request
,
'reversal'
,
r
)
return
r
web_server
=
{}
...
...
@@ -590,7 +602,7 @@ def check_job():
continue
iso
=
connection
.
job
.
get_iso
()
if
iso
:
iso_list
=
[
iso
]
iso_list
=
[
iso
]
else
:
if
ip_port
not
in
web_request
:
continue
...
...
@@ -633,7 +645,7 @@ def set_log(conf_file):
log
.
setLevel
(
conf
.
get
(
'logger_root'
,
'level'
))
logs
.
append
(
log
)
logs
=
[]
running
=
[]
...
...
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