Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
iso8583
/
bjb-samsat-banten
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 9b371100
authored
Apr 05, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
aagusti
1 parent
298b9bad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
64 deletions
opensipkd/iso8583/bjb/samsat/banten/test_info.py
setup.py
opensipkd/iso8583/bjb/samsat/banten/test_info.py
View file @
9b37110
...
@@ -9,14 +9,10 @@ from iso8583_web.read_conf import read_conf, name_conf, ip_conf
...
@@ -9,14 +9,10 @@ from iso8583_web.read_conf import read_conf, name_conf, ip_conf
from
.doc
import
Doc
from
.doc
import
Doc
from
.job
import
Job
from
.job
import
Job
def
main
(
argv
=
sys
.
argv
):
def
get_option
(
argv
):
# Blok Utama #
bank_id
=
'110'
##############
global
conf
conf_file
=
os
.
path
.
join
(
'conf'
,
'forwarder.py'
)
host_name
=
'bjb'
log_dir
=
'logs'
log_dir
=
'logs'
method
=
'get_
tagihan
'
method
=
'get_
kd_bayar
'
host
=
'bjb'
host
=
'bjb'
no_rangka
=
""
no_rangka
=
""
no_ktp
=
""
no_ktp
=
""
...
@@ -24,6 +20,7 @@ def main(argv=sys.argv):
...
@@ -24,6 +20,7 @@ def main(argv=sys.argv):
amount
=
0
amount
=
0
pars
=
OptionParser
()
pars
=
OptionParser
()
pars
.
add_option
(
'-p'
,
'--no-pol'
)
pars
.
add_option
(
'-p'
,
'--no-pol'
)
pars
.
add_option
(
'-b'
,
'--bank-id'
,
default
=
bank_id
,
help
=
'diisi 3 digit kode bank'
)
pars
.
add_option
(
'-r'
,
'--no-rangka'
,
default
=
no_rangka
,
help
=
'diisi 5 digit no rangka'
)
pars
.
add_option
(
'-r'
,
'--no-rangka'
,
default
=
no_rangka
,
help
=
'diisi 5 digit no rangka'
)
pars
.
add_option
(
'-k'
,
'--no-ktp'
,
default
=
no_ktp
,
help
=
'diisi dengan no identitas'
)
pars
.
add_option
(
'-k'
,
'--no-ktp'
,
default
=
no_ktp
,
help
=
'diisi dengan no identitas'
)
pars
.
add_option
(
'-a'
,
'--amount'
,
default
=
amount
,
help
=
'diisi nilai pembayaran'
)
pars
.
add_option
(
'-a'
,
'--amount'
,
default
=
amount
,
help
=
'diisi nilai pembayaran'
)
...
@@ -32,69 +29,111 @@ def main(argv=sys.argv):
...
@@ -32,69 +29,111 @@ def main(argv=sys.argv):
pars
.
add_option
(
'-i'
,
'--invoice'
,
default
=
no_invoice
,
help
=
'no tagihan'
)
pars
.
add_option
(
'-i'
,
'--invoice'
,
default
=
no_invoice
,
help
=
'no tagihan'
)
pars
.
add_option
(
'-m'
,
'--method'
,
default
=
method
,
help
=
'default '
+
method
)
pars
.
add_option
(
'-m'
,
'--method'
,
default
=
method
,
help
=
'default '
+
method
)
option
,
remain
=
pars
.
parse_args
(
argv
[
1
:])
option
,
remain
=
pars
.
parse_args
(
argv
[
1
:])
return
option
conf_file
=
os
.
path
.
realpath
(
option
.
conf_file
)
from
iso8583_web.read_conf
import
(
read_conf
,
get_str
,
name_conf
)
# print(conf_file)
class
TestInfo
(
object
):
conf
=
imp
.
load_source
(
'conf'
,
conf_file
)
def
__init__
(
self
,
argv
,
conf
):
method
=
option
.
method
option
=
get_option
(
argv
)
host
=
option
.
host
if
not
option
:
no_pol
=
option
.
no_pol
return
no_rangka
=
option
.
no_rangka
no_ktp
=
option
.
no_ktp
no_invoice
=
option
.
invoice
amount
=
option
.
amount
read_conf
(
conf_file
)
self
.
host
=
option
.
host
self
.
method
=
option
.
method
self
.
kd_bank
=
option
.
bank_id
self
.
no_pol
=
option
.
no_pol
self
.
no_rangka
=
option
.
no_rangka
self
.
no_ktp
=
option
.
no_ktp
self
.
no_invoice
=
option
.
invoice
self
.
amount
=
option
.
amount
self
.
kd_channel
=
'6010'
self
.
conf
=
name_conf
[
self
.
host
]
self
.
kd_biller
=
'00000'
self
.
kd_produk
=
'5'
_host
=
conf
.
host
job
=
Job
(
conf
=
ip_conf
[
''
])
def
run
(
self
):
rpc
=
_host
[
host
][
'samsat_banten'
]
kini
=
datetime
.
now
()
tgl_transaksi
=
kini
.
strftime
(
"
%
Y
%
m
%
d"
)
kd_bank
=
'110'
,
jam_transaksi
=
kini
.
strftime
(
"
%
H
%
M
%
S"
)
kd_biller
=
'0000'
message
=
dict
(
kd_bank
=
conf
.
host
[
host
][
'id'
],
kd_produk
=
'5'
kd_biller
=
rpc
[
'kd_biller'
],
kini
=
datetime
.
now
()
kd_channel
=
'6010'
,
tgl_transaksi
=
kini
.
strftime
(
"
%
Y
%
m
%
d"
)
kd_produk
=
rpc
[
'kd_produk'
],
jam_transaksi
=
kini
.
strftime
(
"
%
H
%
M
%
S"
)
)
message
=
dict
(
kd_bank
=
self
.
kd_bank
,
if
method
==
'get_tagihan'
:
kd_biller
=
self
.
kd_biller
,
message
.
update
(
dict
(
no_polisi
=
no_pol
))
kd_channel
=
self
.
kd_channel
,
elif
method
==
'get_kd_bayar'
:
kd_produk
=
self
.
kd_produk
,
message
.
update
(
)
dict
(
no_polisi
=
no_pol
,
no_identitas
=
no_ktp
,
if
self
.
method
==
'get_tagihan'
:
no_rangka
=
no_rangka
message
.
update
(
dict
(
no_polisi
=
self
.
no_pol
))
)
elif
self
.
method
==
'get_kd_bayar'
:
)
message
.
update
(
elif
method
==
'inquiry'
:
dict
(
no_polisi
=
self
.
no_pol
,
message
.
update
(
no_identitas
=
self
.
no_ktp
,
dict
(
no_rangka
=
self
.
no_rangka
invoice_no
=
no_invoice
)
)
)
)
elif
self
.
method
==
'inquiry'
:
elif
method
==
'payment'
:
message
.
update
(
message
.
update
(
dict
(
dict
(
invoice_no
=
self
.
no_invoice
invoice_no
=
no_invoice
,
)
ntb
=
'12345BHJJJK'
,
amount
=
int
(
amount
),
tgl_transaksi
=
tgl_transaksi
,
jam_transaksi
=
jam_transaksi
,
)
)
)
elif
self
.
method
==
'payment'
:
elif
method
==
'reversal'
:
message
.
update
(
message
.
update
(
dict
(
dict
(
invoice_no
=
self
.
no_invoice
,
invoice_no
=
no_invoice
,
ntb
=
'12345BHJJJK'
,
ntb
=
'12345BHJJJK'
,
amount
=
int
(
self
.
amount
),
amount
=
int
(
amount
),
tgl_transaksi
=
tgl_transaksi
,
tgl_transaksi
=
tgl_transaksi
,
jam_transaksi
=
jam_transaksi
,
jam_transaksi
=
jam_transaksi
,
)
ntp
=
'1993797040'
)
elif
self
.
method
==
'reversal'
:
message
.
update
(
dict
(
invoice_no
=
self
.
no_invoice
,
ntb
=
'12345BHJJJK'
,
amount
=
int
(
self
.
amount
),
tgl_transaksi
=
tgl_transaksi
,
jam_transaksi
=
jam_transaksi
,
ntp
=
'1993797040'
)
)
)
doc
=
Doc
(
conf
=
self
.
conf
)
rows
=
doc
.
send_rpc
(
self
.
method
,
message
)
from
iso8583_web.read_conf
import
(
read_conf
,
get_str
,
name_conf
)
import
logging
from
pyramid.paster
import
setup_logging
from
iso8583_web.scripts.forwarder
import
logs
try
:
from
configparser
import
(
ConfigParser
,
NoOptionError
,
)
except
ImportError
:
from
ConfigParser
import
(
ConfigParser
,
NoOptionError
,
)
)
# rpc = conf.rpc
rows
=
send_rpc
(
rpc
[
'user'
],
rpc
[
'key'
],
rpc
[
'url'
],
method
,
message
)
# print(rpc['user'], rpc['key'], rpc['url'], method, message)
def
main
(
argv
=
sys
.
argv
):
option
=
get_option
(
argv
)
conf_file
=
os
.
path
.
realpath
(
option
.
conf_file
)
read_conf
(
conf_file
)
setup_logging
(
conf_file
)
log
=
logging
.
getLogger
(
__file__
)
logs
.
append
(
log
)
conf
=
ConfigParser
()
conf
.
read
(
conf_file
)
localization
=
get_str
(
conf
,
'main'
,
'localization'
,
default
=
'id_ID.UTF-8'
)
locale
.
setlocale
(
locale
.
LC_ALL
,
localization
)
test
=
TestInfo
(
argv
,
conf
)
test
.
run
()
setup.py
View file @
9b37110
...
@@ -36,6 +36,8 @@ setup(
...
@@ -36,6 +36,8 @@ setup(
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'console_scripts'
:
[
'initialize_bjb_samsat_db = opensipkd.iso8583.bjb.samsat.scripts.initialize_db:main'
,
'initialize_bjb_samsat_db = opensipkd.iso8583.bjb.samsat.scripts.initialize_db:main'
,
'test-info-samsat-banten = opensipkd.iso8583.bjb.samsat.banten.test_info:main'
,
]
]
}
}
)
)
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