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 a2d0fc24
authored
Sep 15, 2020
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'sambat' of
https://git.opensipkd.com/sugiana/iso8583-web
into sambat
2 parents
8eb6a40a
d3f34708
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
16 deletions
iso8583_web/scripts/views/sambat/__init__.py
iso8583_web/scripts/views/sambat/structure.py
iso8583_web/scripts/views/sambat/__init__.py
View file @
a2d0fc2
...
...
@@ -52,6 +52,8 @@ class View(BaseView):
bit_003
=
iso
.
data
[
"processingCode"
])
try
:
data
=
iso
.
data
[
"additionalData"
]
if
data
:
log_web_debug
(
data
)
profile
=
FixLength
(
INVOICE_PROFILE
)
profile
.
set_raw
(
data
)
iso_log
.
bit_062_data
=
profile
.
to_dict
()
...
...
iso8583_web/scripts/views/sambat/structure.py
View file @
a2d0fc2
...
...
@@ -12,19 +12,24 @@ from iso8583_web.scripts.views.linkaja.models import LogSam
from
iso8583_web.tools.this_framework
import
get_settings
from
datetime
import
datetime
import
requests
INQ_CODE
=
"301099"
PAY_CODE
=
"541099"
FEAT_CODE
=
"017"
TERM_ID
=
"SLR"
TERM_NAME
=
"LINKAJA"
CARD_NAME
=
TERM_NAME
INQ_REQ
=
{
"primaryAccountNumber"
:
"622011888888888888"
,
"processingCode"
:
"321000"
,
"processingCode"
:
INQ_CODE
,
"amountTransaction"
:
""
,
"settlementDate"
:
"0326"
,
"merchantType"
:
"6015"
,
"aggregatorCode"
:
"W0216"
,
"caCode"
:
"CA1830"
,
"terminalAggregator"
:
{
"terminalIdentifierNumber"
:
"7782"
,
"terminalName"
:
"BJBSAM"
,
"cardAcceptorName"
:
"BJBSAM"
"terminalIdentifierNumber"
:
TERM_ID
,
"terminalName"
:
TERM_NAME
,
"cardAcceptorName"
:
CARD_NAME
},
"currencyCode"
:
"360"
,
"amountInformation"
:
{
...
...
@@ -34,7 +39,7 @@ INQ_REQ = {
"totalAmount"
:
""
},
"pay"
:
"PAY"
,
"featureCode"
:
"009"
,
"featureCode"
:
FEAT_CODE
,
"billInformation"
:
{
"bills"
:
[{
"info"
:
"1000000108767"
...
...
@@ -55,7 +60,7 @@ INQ_REQ = {
PAY_REQ
=
\
{
"processingCode"
:
"521000"
,
"processingCode"
:
PAY_CODE
,
"sequenceNumber"
:
""
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
""
,
...
...
@@ -79,9 +84,9 @@ def send_data(json_data, conf):
"http://localhost:7001/bjb/sambat/test"
data
=
json_data
# todo butuh server buat testing json sementara pake static response
if
json_data
[
"processingCode"
]
==
'321000'
:
if
json_data
[
"processingCode"
]
==
INQ_CODE
:
bjb_sam_url
+=
"/inquiryPaymentRest"
elif
json_data
[
"processingCode"
]
==
'521000'
:
elif
json_data
[
"processingCode"
]
==
PAY_CODE
:
bjb_sam_url
+=
"/paymentRest"
log_web_info
(
json
.
dumps
(
data
))
r
=
requests
.
post
(
bjb_sam_url
,
json
=
data
)
...
...
@@ -104,30 +109,42 @@ class Transaksi(object):
self
.
response
=
None
if
method
==
"reversal"
:
# data Payment ada (berarti reversal)
self
.
mti
=
"0400"
self
.
data
[
"processingCode"
]
=
"521000"
self
.
data
[
"processingCode"
]
=
PAY_CODE
elif
method
==
"payment"
:
# data Inq ada (berarti payment)
db_session
=
get_db_session
()
pay
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0200"
,
bit_003
=
'521000'
)
.
first
()
pay
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0200"
,
bit_003
=
PAY_CODE
)
.
first
()
if
pay
:
pay
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0210"
,
bit_003
=
'521000'
)
.
first
()
pay
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0210"
,
bit_003
=
PAY_CODE
)
.
first
()
if
pay
:
raise
AlreadyPaidError
()
inq
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0210"
,
bit_003
=
'321000'
)
.
first
()
inq
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0210"
,
bit_003
=
INQ_CODE
)
.
first
()
if
not
inq
:
raise
BillRefNotFound
()
self
.
mti
=
"0200"
self
.
data
=
inq
.
message
self
.
data
[
"processingCode"
]
=
"521000"
self
.
data
[
"processingCode"
]
=
PAY_CODE
#stan = int(self.data["systemTraceAuditNumber"])+1
#self.data["systemTraceAuditNumber"] = str(stan).zfill(6)
self
.
set_local_time
()
#elf.data["systemTraceAuditNumber"] = str(stan).zfill(6)
self
.
data
[
"systemTraceAuditNumber"
]
=
self
.
data
[
"timeLocalTransaction"
]
else
:
self
.
mti
=
"0200"
self
.
data
=
INQ_REQ
.
copy
()
# self.data["systemTraceAuditNumber"] = "880977"
self
.
data
[
"caCode"
]
=
"ca_code"
in
conf
and
conf
[
"ca_code"
]
or
"123456"
self
.
data
[
"processingCode"
]
=
"321000"
self
.
data
[
"aggregatorCode"
]
=
"agg_code"
in
conf
\
and
conf
[
"agg_code"
]
or
"W0227"
self
.
data
[
"caCode"
]
=
"ca_code"
in
conf
and
conf
[
"ca_code"
]
\
or
"CA1864"
self
.
data
[
"processingCode"
]
=
INQ_CODE
self
.
data
[
"billInformation"
][
"bills"
][
0
][
"info"
]
=
p
[
"invoice_id"
]
self
.
set_local_time
()
...
...
@@ -136,6 +153,7 @@ class Transaksi(object):
self
.
data
[
"timeLocalTransaction"
]
=
time
.
strftime
(
"
%
H
%
M
%
S"
)
self
.
data
[
"localTransactionDate"
]
=
time
.
strftime
(
"
%
m
%
d"
)
self
.
data
[
"transmissionDateTime"
]
=
time
.
strftime
(
"
%
m
%
d
%
H
%
M
%
S"
)
self
.
data
[
"settlementDate"
]
=
time
.
strftime
(
"
%
m
%
d"
)
def
get_stan
(
self
):
return
self
.
data
[
"systemTraceAuditNumber"
]
...
...
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