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 e5822e4b
authored
Sep 18, 2020
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
tambah profile sambat
1 parent
2cc62773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
4 deletions
iso8583_web/scripts/views/sambat/__init__.py
iso8583_web/scripts/views/sambat/structure.py
iso8583_web/scripts/views/sambat/__init__.py
View file @
e5822e4
...
@@ -11,13 +11,13 @@ from opensipkd.string import (
...
@@ -11,13 +11,13 @@ from opensipkd.string import (
FixLength
,
FixLength
,
)
)
from
.structure
import
INVOICE_PROFILE
from
.structure
import
INVOICE_PROFILE
,
InquiryResponse
,
PaymentResponse
from
.structure
import
Transaksi
from
.structure
import
Transaksi
from
..
import
View
as
BaseView
from
..
import
View
as
BaseView
# View as BaseView,
# View as BaseView,
from
..linkaja
import
(
from
..linkaja
import
(
WebJob
,
is_inquiry
,
get_db_session
,
is_reversal
,
is_payment
,
get_method
,
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_form
,
date_from_str
,
csv_method
,
get_inquiry
,
get_payment
)
get_payment
)
from
..linkaja.exceptions
import
(
from
..linkaja.exceptions
import
(
InvoiceIdError
,
NeedPostError
,
InternalError
,
HostError
,
AlreadyPaidError
,
InvoiceIdError
,
NeedPostError
,
InternalError
,
HostError
,
AlreadyPaidError
,
...
@@ -30,6 +30,14 @@ ROUTE = 'linkaja/sambat'
...
@@ -30,6 +30,14 @@ ROUTE = 'linkaja/sambat'
conf
=
dict
()
conf
=
dict
()
def
get_template_response
(
data
):
if
is_inquiry
(
data
):
return
InquiryResponse
()
d
=
PaymentResponse
()
d
[
'Bill Ref'
]
=
data
[
'bill_ref'
]
return
d
class
View
(
BaseView
):
class
View
(
BaseView
):
def
get_web_job_cls
(
self
):
# Override
def
get_web_job_cls
(
self
):
# Override
return
WebJob
return
WebJob
...
@@ -104,6 +112,8 @@ class View(BaseView):
...
@@ -104,6 +112,8 @@ class View(BaseView):
iso_log
.
bit_062_data
=
profile
.
to_dict
()
iso_log
.
bit_062_data
=
profile
.
to_dict
()
web_data
[
'Biller Name'
]
=
row
.
biller_name
=
\
web_data
[
'Biller Name'
]
=
row
.
biller_name
=
\
' '
.
join
([
profile
[
'NOMOR POLISI'
],
profile
[
'NAMA PEMILIK'
]
.
strip
()])
' '
.
join
([
profile
[
'NOMOR POLISI'
],
profile
[
'NAMA PEMILIK'
]
.
strip
()])
web_data
[
'Bill Data'
]
=
profile
.
to_dict
()
web_data
[
'Bill Amount'
]
=
iso_data
[
"amountTransaction"
]
.
lstrip
(
'0'
)
web_data
[
'Bill Amount'
]
=
iso_data
[
"amountTransaction"
]
.
lstrip
(
'0'
)
if
"numberTransactionP"
in
iso_data
and
iso_data
[
"numberTransactionP"
]:
if
"numberTransactionP"
in
iso_data
and
iso_data
[
"numberTransactionP"
]:
web_data
[
'Transaction ID'
]
=
row
.
ntp
=
iso_data
[
"numberTransactionP"
]
# NTP
web_data
[
'Transaction ID'
]
=
row
.
ntp
=
iso_data
[
"numberTransactionP"
]
# NTP
...
...
iso8583_web/scripts/views/sambat/structure.py
View file @
e5822e4
...
@@ -9,11 +9,15 @@ from iso8583_web.scripts.logger import (
...
@@ -9,11 +9,15 @@ from iso8583_web.scripts.logger import (
log_web_debug
)
log_web_debug
)
import
requests
import
requests
from
iso8583_web.scripts.views.linkaja
import
get_db_session
,
AlreadyPaidError
,
BillRefNotFound
,
BaseError
from
iso8583_web.scripts.views.linkaja
import
(
get_db_session
,
AlreadyPaidError
,
BillRefNotFound
,
BaseError
,
InquiryResponse
as
InquiryResponseBase
)
from
iso8583_web.scripts.views.linkaja.models
import
LogSam
from
iso8583_web.scripts.views.linkaja.models
import
LogSam
from
iso8583_web.scripts.views.linkaja.structure
import
INQUIRY_RESP_FIELDS
,
PAYMENT_RESP_FIELDS
from
iso8583_web.tools.this_framework
import
get_settings
from
iso8583_web.tools.this_framework
import
get_settings
from
datetime
import
datetime
from
datetime
import
datetime
import
requests
import
requests
from
opensipkd.string.row
import
Row
INQ_CODE
=
"301099"
INQ_CODE
=
"301099"
PAY_CODE
=
"541099"
PAY_CODE
=
"541099"
...
@@ -149,6 +153,20 @@ class Transaksi(object):
...
@@ -149,6 +153,20 @@ class Transaksi(object):
self
.
mti
=
self
.
mti
==
"0200"
and
"0210"
or
"0410"
self
.
mti
=
self
.
mti
==
"0200"
and
"0210"
or
"0410"
class
InquiryResponse
(
InquiryResponseBase
):
def
__init__
(
self
):
inq_resp_field
=
INQUIRY_RESP_FIELDS
inq_resp_field
.
append
(
'Bill Data'
)
Row
.
__init__
(
inq_resp_field
)
class
PaymentResponse
(
InquiryResponse
):
def
__init__
(
self
):
inq_resp_field
=
PAYMENT_RESP_FIELDS
inq_resp_field
.
append
(
'Bill Data'
)
Row
.
__init__
(
self
,
inq_resp_field
)
INVOICE_PROFILE
=
[
INVOICE_PROFILE
=
[
(
"NOMOR BAYAR"
,
16
,
"N"
),
(
"NOMOR BAYAR"
,
16
,
"N"
),
(
"NOMOR RANGKA"
,
25
),
(
"NOMOR RANGKA"
,
25
),
...
@@ -178,4 +196,3 @@ INVOICE_PROFILE = [
...
@@ -178,4 +196,3 @@ INVOICE_PROFILE = [
(
"KETERANGAN"
,
90
),
(
"KETERANGAN"
,
90
),
(
"RESERVED_01"
,
5
)
(
"RESERVED_01"
,
5
)
]
]
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