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 8eb6a40a
authored
Sep 15, 2020
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add acc_no to payment request
1 parent
a0d578ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
29 deletions
iso8583_web/scripts/views/linkaja/__init__.py
iso8583_web/scripts/views/sambat/__init__.py
iso8583_web/scripts/views/linkaja/__init__.py
View file @
8eb6a40
...
...
@@ -5,34 +5,34 @@ from sqlalchemy import create_engine
from
sqlalchemy.orm
import
(
sessionmaker
,
scoped_session
,
)
)
from
zope.sqlalchemy
import
register
from
pyramid.view
import
(
view_config
,
notfound_view_config
,
)
)
from
pyramid.response
import
Response
from
deform
import
(
Form
,
Button
,
ValidationFailure
,
)
)
import
colander
from
opensipkd.string
import
(
FixLength
,
FullDateTimeVar
,
)
)
from
opensipkd.iso8583.bjb.pbb.structure
import
INVOICE_PROFILE
from
iso8583_web.scripts.tools
import
iso_to_dict
from
iso8583_web.read_conf
import
web_path_conf
from
iso8583_web.scripts.logger
import
(
log_web_info
,
log_web_error
,
)
)
from
..
import
(
WebJob
as
BaseWebJob
,
View
as
BaseView
,
)
)
from
.exceptions
import
(
InvoiceIdError
,
NeedPostError
,
...
...
@@ -45,18 +45,17 @@ from .exceptions import (
AmountError
,
BillRefNotFound
,
PaymentNotFound
,
)
)
from
.structure
import
(
DataRequest
,
InquiryResponse
,
PaymentResponse
,
)
)
from
.renderer
import
Renderer
from
.models
import
(
Rpc
,
Log
,
)
)
ROUTE
=
'linkaja'
RENDERER
=
'csv'
...
...
@@ -104,6 +103,9 @@ def get_inquiry(data):
DBSession
=
get_db_session
()
bill_ref
=
int
(
data
[
'bill_ref'
])
q
=
DBSession
.
query
(
Rpc
)
.
filter_by
(
id
=
bill_ref
)
# todo: Perlu ditambahkan data["acc_no"] sebagai filter untuk meningkatkan
# validasi data sehingga kesalahan akibat dari client mengubah acc_no
# dapat ditingkatkan.
return
q
.
first
()
...
...
@@ -272,14 +274,14 @@ class View(BaseView):
inq
=
get_inquiry
(
data
)
if
not
inq
:
raise
BillRefNotFound
()
#ditambahkan karena harus sesuai dengan inq
#
ditambahkan karena harus sesuai dengan inq
DBSession
=
get_db_session
()
iso_log
=
DBSession
.
query
(
Log
)
.
\
filter
(
Log
.
rpc_id
==
inq
.
id
,
iso_log
=
DBSession
.
query
(
Log
)
.
\
filter
(
Log
.
rpc_id
==
inq
.
id
,
Log
.
bit_062
!=
None
)
.
first
()
if
not
iso_log
:
raise
BillRefNotFound
()
p
[
'bits'
]
=
{
"62"
:
iso_log
.
bit_062
,
p
[
'bits'
]
=
{
"62"
:
iso_log
.
bit_062
,
"37"
:
""
.
join
([
'000000'
,
iso_log
.
bit_011
])}
else
:
pay
=
get_payment
(
data
)
...
...
@@ -291,8 +293,8 @@ class View(BaseView):
if
'bits'
not
in
p
:
p
[
'bits'
]
=
{}
p
[
'bits'
][
'107'
]
=
'LINKAJA'
p
[
'bits'
][
'49'
]
=
'AGRATEK-LINKAJA'
p
[
'bits'
][
'107'
]
=
'LINKAJA'
p
[
'bits'
][
'49'
]
=
'AGRATEK-LINKAJA'
conn
=
self
.
get_connection
()
method
=
get_method
(
data
)
...
...
iso8583_web/scripts/views/sambat/__init__.py
View file @
8eb6a40
...
...
@@ -14,21 +14,14 @@ from opensipkd.string import (
from
.structure
import
INVOICE_PROFILE
from
.structure
import
Transaksi
from
..
import
View
as
BaseView
# View as BaseView,
from
..linkaja
import
(
WebJob
,
# View as BaseView,
is_inquiry
,
get_db_session
,
is_reversal
,
is_payment
,
get_method
,
get_form
,
date_from_str
,
csv_method
,
get_template_response
,
get_inquiry
,
get_payment
)
WebJob
,
is_inquiry
,
get_db_session
,
is_reversal
,
is_payment
,
get_method
,
get_form
,
date_from_str
,
csv_method
,
get_template_response
,
get_inquiry
,
get_payment
)
from
..linkaja.exceptions
import
(
InvoiceIdError
,
NeedPostError
,
InternalError
,
HostError
,
AlreadyPaidError
,
BaseError
,
AmountError
,
BillRefNotFound
,
PaymentNotFound
,
InvoiceIdError
,
NeedPostError
,
InternalError
,
HostError
,
AlreadyPaidError
,
BaseError
,
AmountError
,
BillRefNotFound
,
PaymentNotFound
,
)
from
..linkaja.models
import
(
Rpc
,
LogSam
)
...
...
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