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 ce7e4d5f
authored
Sep 07, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Web client LinkAja ada opsi --timeout
1 parent
280ee07e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
5 deletions
CHANGES.txt
README.rst
iso8583-aggregator.ini
iso8583_web/scripts/views/__init__.py
iso8583_web/scripts/views/linkaja/__init__.py
iso8583_web/scripts/web_client_linkaja.py
CHANGES.txt
View file @
ce7e4d5
0.3.3 2020-09-07
----------------
- web_client_linkaja.py ada opsi --timeout
0.3.2 2020-08-27
----------------
- Penyesuaian linkaja dimana tahun bisa saja di msg.
...
...
README.rst
View file @
ce7e4d5
...
...
@@ -458,6 +458,11 @@ database-nya terlebih dahulu. Lalu buatlah file ``test-agratek.ini``::
allowed_ip =
127.0.0.1
10.8.30.1
# Notification Message sesuai prefix Invoice ID
notification_message =
3271:PBB Kota Bogor
3676:PBB Kota Tangerang Selatan
3275:PBB Kota Bekasi
[host_bjb]
ip = 127.0.0.1
...
...
iso8583-aggregator.ini
View file @
ce7e4d5
...
...
@@ -51,6 +51,11 @@ module = iso8583_web.scripts.views.linkaja
host
=
bjb
timeout
=
30
db_url
=
postgresql://user:pass@localhost/db
# Notification Message sesuai prefix Invoice ID
notification_message
=
3271:PBB
Kota
Bogor
3676:PBB
Kota
Tangerang
Selatan
3275:PBB
Kota
Bekasi
[host_bjb]
ip
=
127.0.0.1
...
...
iso8583_web/scripts/views/__init__.py
View file @
ce7e4d5
...
...
@@ -150,5 +150,6 @@ class View:
def
web_job
(
self
,
conn
,
iso
):
conf
=
self
.
get_web_conf
()
job
=
WebJob
(
conn
,
iso
,
conf
)
cls
=
self
.
get_web_job_cls
()
job
=
cls
(
conn
,
iso
,
conf
)
return
job
.
get_response
()
iso8583_web/scripts/views/linkaja/__init__.py
View file @
ce7e4d5
...
...
@@ -76,7 +76,7 @@ def get_db_session():
return
conf
[
'db_session'
]
class
Web
j
ob
(
BaseWebJob
):
class
Web
J
ob
(
BaseWebJob
):
def
timeout_error
(
self
):
# override
return
TimeoutError
()
...
...
iso8583_web/scripts/web_client_linkaja.py
View file @
ce7e4d5
...
...
@@ -27,15 +27,17 @@ default_merchant = 'ldmjakarta1'
default_terminal
=
'Terminal Name'
default_pwd
=
'ldmjkt1pass'
default_msisdn
=
'628111234567'
default_timeout
=
35
help_url
=
'default '
+
default_url
help_count
=
'default {}'
.
format
(
default_count
)
help_count
=
f
'default {default_count}'
help_amount
=
'wajib saat --payment dan --reversal'
help_bill_ref
=
'wajib saat payment dan reversal, '
\
'diperoleh dari inquiry response'
help_trx_id
=
'Nomor Transaksi Bank, '
\
'opsional saat --payment, wajib saat --reversal'
help_merchant
=
'default {}'
.
format
(
default_merchant
)
help_merchant
=
'default '
+
default_merchant
help_timeout
=
f
'default {default_timeout} detik'
ERRORS
=
[
...
...
@@ -72,15 +74,18 @@ def get_option(argv):
parser
.
add_argument
(
'--pwd'
,
default
=
default_pwd
)
parser
.
add_argument
(
'--msisdn'
,
default
=
default_msisdn
)
parser
.
add_argument
(
'--msg'
,
default
=
''
)
parser
.
add_argument
(
'--timeout'
,
help
=
help_timeout
,
default
=
default_timeout
,
type
=
int
)
return
parser
.
parse_args
(
argv
)
def
send
(
thread_id
,
p
):
url
=
server_info
[
'url'
]
timeout
=
server_info
[
'timeout'
]
log_info
(
'Request: {}'
.
format
(
p
))
start
=
time
()
try
:
resp
=
requests
.
post
(
url
,
data
=
p
,
headers
=
headers
,
timeout
=
10
)
resp
=
requests
.
post
(
url
,
data
=
p
,
headers
=
headers
,
timeout
=
timeout
)
durations
[
thread_id
]
=
time
()
-
start
data
=
p
[
'trx_type'
]
==
'021'
and
InquiryResponse
()
or
\
PaymentResponse
()
...
...
@@ -162,6 +167,7 @@ class App:
def
__init__
(
self
,
argv
):
self
.
option
=
get_option
(
argv
)
server_info
[
'url'
]
=
self
.
option
.
url
server_info
[
'timeout'
]
=
self
.
option
.
timeout
def
create_thread
(
self
,
thread_id
,
data
):
thread
=
Thread
(
target
=
send
,
args
=
[
thread_id
,
data
])
...
...
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