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 f89c092d
authored
Sep 15, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed penggunaan pyramid_linkaja
1 parent
caa7ba2d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
15 deletions
iso8583_web/scripts/forwarder.py
iso8583_web/scripts/views/jsonrpc.py
iso8583_web/scripts/views/linkaja.py
iso8583_web/scripts/web_client.py
iso8583_web/scripts/web_client_linkaja.py
setup.py
iso8583_web/scripts/forwarder.py
View file @
f89c092
...
...
@@ -221,7 +221,7 @@ class RequestHandler(BaseRequestHandler, CommonConnection):
def
run
(
self
):
try
:
BaseRequestHandler
.
run
(
self
)
except
:
except
Exception
:
self
.
log_unknown
()
...
...
@@ -287,7 +287,7 @@ class Client(BaseClient, CommonConnection):
def
run
(
self
):
try
:
BaseClient
.
run
(
self
)
except
:
except
Exception
:
self
.
log_unknown
()
...
...
@@ -337,7 +337,7 @@ class Parser(Log):
self
.
log_decode
(
from_iso
)
try
:
iso
=
self
.
connection
.
job
.
process
(
from_iso
)
except
:
except
Exception
:
self
.
log_unknown
()
self
.
running
=
False
return
...
...
@@ -349,7 +349,7 @@ class Parser(Log):
if
for_host
:
try
:
self
.
send_iso_for_host
(
iso
)
except
:
except
Exception
:
self
.
log_unknown
()
else
:
self
.
send
(
iso
)
...
...
@@ -376,7 +376,7 @@ class Parser(Log):
try
:
iso
.
continue_response
(
from_iso
)
ok
=
True
except
:
except
Exception
:
self
.
log_unknown
()
ok
=
False
if
ok
:
...
...
iso8583_web/scripts/views/jsonrpc.py
View file @
f89c092
iso8583_web/scripts/views/linkaja.py
View file @
f89c092
...
...
@@ -24,7 +24,7 @@ from iso8583_web.scripts.logger import (
log_web_info
,
log_web_error
,
)
from
.
.
import
(
from
.
import
(
WebJob
as
BaseWebJob
,
View
as
BaseView
,
)
...
...
@@ -42,15 +42,20 @@ from pyramid_linkaja.exceptions import (
PaymentNotFound
,
LinkError
,
)
from
pyramid_linkaja.response
import
(
from
pyramid_linkaja.response
s
import
(
InquiryResponse
,
PaymentResponse
,
get_trx_date
,
is_inquiry
,
is_payment
,
is_reversal
,
)
from
pyramid_linkaja.decorator
import
csv_method
from
pyramid_linkaja.structure
import
RENDERER
from
pyramid_linkaja.form
import
get_form
ROUTE
=
'linkaja'
RENDERER
=
'csv'
conf
=
dict
()
...
...
@@ -178,7 +183,8 @@ class View(BaseView):
profile
=
FixLength
(
INVOICE_PROFILE
)
profile
.
set_raw
(
iso_data
[
62
])
iso_log
.
bit_062_data
=
profile
.
to_dict
()
web_data
[
'Biller Name'
]
=
row
.
biller_name
=
profile2name
(
profile
)
web_data
[
'Biller Name'
]
=
row
.
biller_name
=
\
profile2name
(
profile
)
web_data
[
'Bill Amount'
]
=
iso_data
[
4
]
.
lstrip
(
'0'
)
if
iso_data
.
get
(
47
):
web_data
[
'Transaction ID'
]
=
row
.
ntp
=
iso_data
[
47
]
# NTP
...
...
@@ -283,7 +289,7 @@ def view_exception(exc, request):
r
[
'Response Code'
]
=
exc
.
code
r
[
'Notification Message'
]
=
exc
.
message
prefix
=
log_prefix
(
request
)
msg
=
'{} {} {}'
.
format
(
prefix
,
'Send'
,
r
)
msg
=
f
'{prefix} Send {r}'
log_web_error
(
msg
)
response
=
Response
(
str
(
r
))
response
.
status_int
=
200
...
...
iso8583_web/scripts/web_client.py
View file @
f89c092
...
...
@@ -36,7 +36,6 @@ def error(s):
sys
.
exit
()
def
log_info
(
s
):
t
=
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S.
%
f'
)
t
=
t
[:
-
3
]
...
...
@@ -143,7 +142,8 @@ def show_durations():
if
key_fastest
!=
key_slowest
:
log_info
(
'Tercepat {}'
.
format
(
messages
[
key_fastest
]))
log_info
(
'Terlama {}'
.
format
(
messages
[
key_slowest
]))
log_info
(
'Rerata {} detik / request'
.
format
(
total_duration
/
len
(
durations
)))
log_info
(
'Rerata {} detik / request'
.
format
(
total_duration
/
len
(
durations
)))
show_errors
(
errors
)
...
...
iso8583_web/scripts/web_client_linkaja.py
View file @
f89c092
...
...
@@ -8,7 +8,7 @@ from time import (
)
from
threading
import
Thread
from
argparse
import
ArgumentParser
from
.views.linkaja.structure
import
(
from
pyramid_linkaja.responses
import
(
InquiryResponse
,
PaymentResponse
,
)
...
...
@@ -159,7 +159,8 @@ def show_durations():
if
tid_fastest
!=
tid_slowest
:
log_info
(
'Tercepat {}'
.
format
(
messages
[
tid_fastest
]))
log_info
(
'Terlama {}'
.
format
(
messages
[
tid_slowest
]))
log_info
(
'Rerata {} detik / request'
.
format
(
total_duration
/
len
(
durations
)))
log_info
(
'Rerata {} detik / request'
.
format
(
total_duration
/
len
(
durations
)))
show_errors
(
errors
)
...
...
setup.py
View file @
f89c092
...
...
@@ -34,7 +34,7 @@ requires = [
'opensipkd-base @ git+https://git.opensipkd.com/sugiana/opensipkd-base.git'
,
'opensipkd-iso8583 @ git+https://git.opensipkd.com/sugiana/opensipkd-iso8583.git'
,
'opensipkd-hitung @ git+https://git.opensipkd.com/sugiana/opensipkd-hitung.git'
,
'
opensipkd-hitung
@ git+https://git.opensipkd.com/sugiana/pyramid-linkaja.git'
,
'
pyramid-linkaja
@ git+https://git.opensipkd.com/sugiana/pyramid-linkaja.git'
,
]
...
...
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