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 4f72dce1
authored
Oct 06, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
linkaja: validasi prefix Invoice ID PBB
1 parent
66a42da5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
16 deletions
CHANGES.txt
iso8583-bank.ini
iso8583_web/scripts/views/linkaja/__init__.py
iso8583_web/scripts/views/linkaja/pbb.py
CHANGES.txt
View file @
4f72dce
0.3.4 2020-10-0
3
0.3.4 2020-10-0
6
----------------
- Validasi prefix Invoice ID PBB LinkAja
- Saat payment linkaja mengambil invoice ID berdasarkan Bill Ref
0.3.3 2020-09-14
...
...
iso8583-bank.ini
View file @
4f72dce
...
...
@@ -94,4 +94,5 @@ module = opensipkd.iso8583.bjb.pbb.test
[module_opensipkd.iso8583.bjb.pbb.test]
request_bits
=
18:6025
32:110
33:00110
iso8583_web/scripts/views/linkaja/__init__.py
View file @
4f72dce
from
pyramid.response
import
Response
from
pyramid.view
import
view_config
from
deform
import
ValidationFailure
from
sqlalchemy
import
create_engine
...
...
@@ -52,19 +51,6 @@ def log_receive(self, msg, error=False):
log_web_info
(
msg
)
@view_config
(
context
=
BaseError
)
def
view_exception
(
exc
,
request
):
r
=
InquiryResponse
()
r
[
'Response Code'
]
=
exc
.
code
r
[
'Notification Message'
]
=
exc
.
message
prefix
=
log_prefix
(
request
)
msg
=
f
'{prefix} Send {r}'
log_web_error
(
msg
)
response
=
Response
(
str
(
r
))
response
.
status_int
=
200
return
response
def
pyramid_init
(
pyramid_config
,
h2h_conf
,
route_name
):
pyramid_config
.
add_renderer
(
RENDERER
,
'pyramid_linkaja.renderer.Renderer'
)
path
=
h2h_conf
[
'route_path'
]
...
...
iso8583_web/scripts/views/linkaja/pbb.py
View file @
4f72dce
import
transaction
from
pyramid.view
import
view_config
from
pyramid.response
import
Response
from
ISO8583.ISOErrors
import
BitNotSet
from
opensipkd.string
import
FixLength
from
opensipkd.iso8583.bjb.pbb.structure
import
INVOICE_PROFILE
from
opensipkd.iso8583.bjb.pbb.agratek.models
import
Log
from
iso8583_web.scripts.tools
import
iso_to_dict
from
pyramid_linkaja.exceptions
import
(
InvoiceIdError
,
TrxTypeError
,
...
...
@@ -13,6 +14,7 @@ from pyramid_linkaja.exceptions import (
BillRefNotFound
,
PaymentNotFound
,
LinkError
,
BaseError
,
)
from
pyramid_linkaja.responses
import
(
InquiryResponse
,
...
...
@@ -24,6 +26,9 @@ from pyramid_linkaja.responses import (
is_reversal
,
)
from
pyramid_linkaja.decorator
import
csv_method
from
iso8583_web.scripts.logger
import
log_web_error
from
iso8583_web.scripts.tools
import
iso_to_dict
from
..
import
log_prefix
from
.
import
View
as
BaseView
from
.
import
pyramid_init
as
base_pyramid_init
...
...
@@ -59,6 +64,19 @@ def get_ok_notify(data):
return
''
@view_config
(
context
=
BaseError
)
def
view_exception
(
exc
,
request
):
r
=
InquiryResponse
()
r
[
'Response Code'
]
=
exc
.
code
r
[
'Notification Message'
]
=
exc
.
message
prefix
=
log_prefix
(
request
)
msg
=
f
'{prefix} Send {r}'
log_web_error
(
msg
)
response
=
Response
(
str
(
r
))
response
.
status_int
=
200
return
response
class
View
(
BaseView
):
def
get_db_session
(
self
):
# Override
return
get_db_session
()
...
...
@@ -154,7 +172,13 @@ class View(BaseView):
s
+=
inq
.
msg
return
s
def
validate_data
(
self
,
data
):
prefix_found
=
get_ok_notify
(
data
)
if
not
prefix_found
:
raise
InvoiceIdError
()
def
get_response
(
self
,
data
):
# Override
self
.
validate_data
(
data
)
p
,
inq
,
pay
=
self
.
prepare_response
(
data
)
conn
=
self
.
get_connection
()
method
=
get_method
(
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