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 a3500062
authored
Sep 15, 2020
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan data
1 parent
a2d0fc24
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
157 deletions
iso8583_web/scripts/views/sambat/resp_test.py
iso8583_web/scripts/views/sambat/structure.py
iso8583_web/scripts/views/sambat/resp_test.py
0 → 100644
View file @
a350006
INQ_RESP
=
\
{
"additionalData"
:
"361198483250691012345678901234564 54P879211 3603110611710004 TUMINO NUANSA MEKARSARI B - 1 / 15 RT 004/006 KA 3538 XCBIRU 001SEPEDA MOTOR R2YAMAHA 54P (CAST WHEEL) AT 20132020090920210909000000000000000000000000000000154000000000000000000000035000000000000000000000000000000000000000000000189000SUKSES 01"
,
"aggregatorCode"
:
"W0216"
,
"amountInformation"
:
{
"billAmount"
:
"890000"
,
"feeAggregator"
:
"0"
,
"feeBJB"
:
"0"
,
"totalAmount"
:
"890000"
},
"amountTransaction"
:
"890000"
,
"billInformation"
:
{
"bills"
:
[
{
"info"
:
"1000000108767"
},
{
"info"
:
"ALBUS DUMBLEDORE"
},
{
"info"
:
"BLACK MAGIC"
},
{
"info"
:
"BLACK MAGIC 101"
},
{
"info"
:
"890000"
},
{
"info"
:
"0"
},
{
"info"
:
"2019"
},
{
"info"
:
"0"
},
{
"info"
:
" "
},
{
"info"
:
" REG"
},
{
"info"
:
" "
}
]
},
"caCode"
:
"CA1830"
,
"currencyCode"
:
"360"
,
"destinationAccountNumber"
:
"0012199936360 "
,
"featureCode"
:
"009"
,
"localTransactionDate"
:
"0326"
,
"merchantType"
:
"6015"
,
"pay"
:
"PAY"
,
"posEntryModeCode"
:
"110"
,
"primaryAccountNumber"
:
"622011888888888888"
,
"processingCode"
:
"321000"
,
"responseCode"
:
"00"
,
"sequenceNumber"
:
"000000880977"
,
"settlementDate"
:
"0326"
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
"880977"
,
"terminalAggregator"
:
{
"cardAcceptorName"
:
"NAEE "
,
"terminalIdentifierNumber"
:
"1 "
,
"terminalName"
:
"TERM "
},
"timeLocalTransaction"
:
"090210"
,
"track2Data"
:
"622011888888888888=9912?"
,
"transmissionDateTime"
:
"0107180458"
}
# PAYMENT
PAY_RESP
=
\
{
"additionalData"
:
"'361198483250691012345678901234564 54P879211 3603110611710004 TUMINO NUANSA MEKARSARI B - 1 / 15 RT 004/006 KA 3538 XCBIRU 001SEPEDA MOTOR R2YAMAHA 54P (CAST WHEEL) AT 20132020090920210909000000000000000000000000000000154000000000000000000000035000000000000000000000000000000000000000000000189000SUKSES 01"
,
"aggregatorCode"
:
"W0216"
,
"amountInformation"
:
{
"billAmount"
:
"206500"
,
"feeAggregator"
:
"0"
,
"feeBJB"
:
"0"
,
"totalAmount"
:
"206500"
},
"amountTransaction"
:
"000000890000"
,
"billInformation"
:
{
"bills"
:
[{
"info"
:
"1000000108767"
},
{
"info"
:
"ALBUS DUMBLEDORE"
},
{
"info"
:
"BLACK MAGIC"
},
{
"info"
:
"BLACK MAGIC 101"
},
{
"info"
:
"890000"
},
{
"info"
:
"0"
},
{
"info"
:
"2019"
},
{
"info"
:
"0"
},
{
"info"
:
" "
},
{
"info"
:
" REG"
},
{
"info"
:
" "
}
]
},
"caCode"
:
"CA1830"
,
"currencyCode"
:
"360"
,
"destinationAccountNumber"
:
"0012199936360 "
,
"featureCode"
:
"009"
,
"localTransactionDate"
:
"0326"
,
"merchantType"
:
"6015"
,
"numberTransactionBank"
:
'1234567890'
,
"numberTransactionP"
:
'0987654321'
,
"pay"
:
"PAY"
,
"posEntryModeCode"
:
"110"
,
"primaryAccountNumber"
:
"622011888888888888"
,
"processingCode"
:
"521000"
,
"responseCode"
:
"00"
,
"sequenceNumber"
:
"000000502959"
,
"settlementDate"
:
"0326"
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
"502959"
,
"terminalAggregator"
:
{
"cardAcceptorName"
:
"NAEE "
,
"terminalIdentifierNumber"
:
"1 "
,
"terminalName"
:
"TERM "
},
"timeLocalTransaction"
:
"090210"
,
"track2Data"
:
"622011888888888888=9912?"
,
"transmissionDateTime"
:
"0107180458"
}
iso8583_web/scripts/views/sambat/structure.py
View file @
a350006
# import colander
# from opensipkd.string.row import Row
# from .exceptions import InternalError
# todo sebaiknya module ini masulk kedalam BJB-SAM-SAMSAT
import
json
from
iso8583_web.scripts.logger
import
(
log_web_info
,
...
...
@@ -12,6 +14,7 @@ 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"
...
...
@@ -58,23 +61,6 @@ INQ_REQ = {
"sequenceNumber"
:
"1"
}
PAY_REQ
=
\
{
"processingCode"
:
PAY_CODE
,
"sequenceNumber"
:
""
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
""
,
"terminalAggregator"
:
{
"cardAcceptorName"
:
"NAEE "
,
"terminalIdentifierNumber"
:
"1 "
,
"terminalName"
:
"TERM "
},
"settlementDate"
:
"0326"
,
"timeLocalTransaction"
:
"090210"
,
"track2Data"
:
"622011888888888888=9912?"
,
"transmissionDateTime"
:
"0107180458"
}
def
send_data
(
json_data
,
conf
):
# settings = get_settings()
...
...
@@ -83,7 +69,6 @@ def send_data(json_data, conf):
bjb_sam_url
=
"bjb_sam_url"
in
conf
and
conf
[
"bjb_sam_url"
]
or
\
"http://localhost:7001/bjb/sambat/test"
data
=
json_data
# todo butuh server buat testing json sementara pake static response
if
json_data
[
"processingCode"
]
==
INQ_CODE
:
bjb_sam_url
+=
"/inquiryPaymentRest"
elif
json_data
[
"processingCode"
]
==
PAY_CODE
:
...
...
@@ -110,18 +95,21 @@ class Transaksi(object):
if
method
==
"reversal"
:
# data Payment ada (berarti reversal)
self
.
mti
=
"0400"
self
.
data
[
"processingCode"
]
=
PAY_CODE
# todo reversal tidak diperbolehkan
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
=
PAY_CODE
)
.
first
()
if
pay
:
pay
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
# 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
=
PAY_CODE
)
.
first
()
if
pay
:
raise
AlreadyPaidError
()
inq
=
db_session
.
query
(
LogSam
)
.
filter_by
(
rpc_id
=
inq
.
id
,
inq
=
db_session
.
query
(
LogSam
)
.
\
filter_by
(
rpc_id
=
inq
.
id
,
mti
=
"0210"
,
bit_003
=
INQ_CODE
)
.
first
()
if
not
inq
:
raise
BillRefNotFound
()
...
...
@@ -129,17 +117,15 @@ class Transaksi(object):
self
.
mti
=
"0200"
self
.
data
=
inq
.
message
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)
# todo: STAN seunik mungkin karena dikhawatirkan dengan detik yang
# sama terdapat payment dengan STAN yang sama
self
.
data
[
"systemTraceAuditNumber"
]
=
self
.
data
[
"timeLocalTransaction"
]
else
:
self
.
mti
=
"0200"
# todo apa perlu dicopy?
self
.
data
=
INQ_REQ
.
copy
()
# self.data["systemTraceAuditNumber"] = "880977"
self
.
data
[
"aggregatorCode"
]
=
"agg_code"
in
conf
\
and
conf
[
"agg_code"
]
or
"W0227"
self
.
data
[
"caCode"
]
=
"ca_code"
in
conf
and
conf
[
"ca_code"
]
\
...
...
@@ -193,132 +179,3 @@ INVOICE_PROFILE = [
(
"RESERVED_01"
,
5
)
]
INQ_RESP
=
\
{
"additionalData"
:
"361198483250691012345678901234564 54P879211 3603110611710004 TUMINO NUANSA MEKARSARI B - 1 / 15 RT 004/006 KA 3538 XCBIRU 001SEPEDA MOTOR R2YAMAHA 54P (CAST WHEEL) AT 20132020090920210909000000000000000000000000000000154000000000000000000000035000000000000000000000000000000000000000000000189000SUKSES 01"
,
"aggregatorCode"
:
"W0216"
,
"amountInformation"
:
{
"billAmount"
:
"890000"
,
"feeAggregator"
:
"0"
,
"feeBJB"
:
"0"
,
"totalAmount"
:
"890000"
},
"amountTransaction"
:
"890000"
,
"billInformation"
:
{
"bills"
:
[
{
"info"
:
"1000000108767"
},
{
"info"
:
"ALBUS DUMBLEDORE"
},
{
"info"
:
"BLACK MAGIC"
},
{
"info"
:
"BLACK MAGIC 101"
},
{
"info"
:
"890000"
},
{
"info"
:
"0"
},
{
"info"
:
"2019"
},
{
"info"
:
"0"
},
{
"info"
:
" "
},
{
"info"
:
" REG"
},
{
"info"
:
" "
}
]
},
"caCode"
:
"CA1830"
,
"currencyCode"
:
"360"
,
"destinationAccountNumber"
:
"0012199936360 "
,
"featureCode"
:
"009"
,
"localTransactionDate"
:
"0326"
,
"merchantType"
:
"6015"
,
"pay"
:
"PAY"
,
"posEntryModeCode"
:
"110"
,
"primaryAccountNumber"
:
"622011888888888888"
,
"processingCode"
:
"321000"
,
"responseCode"
:
"00"
,
"sequenceNumber"
:
"000000880977"
,
"settlementDate"
:
"0326"
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
"880977"
,
"terminalAggregator"
:
{
"cardAcceptorName"
:
"NAEE "
,
"terminalIdentifierNumber"
:
"1 "
,
"terminalName"
:
"TERM "
},
"timeLocalTransaction"
:
"090210"
,
"track2Data"
:
"622011888888888888=9912?"
,
"transmissionDateTime"
:
"0107180458"
}
# PAYMENT
PAY_RESP
=
\
{
"additionalData"
:
"'361198483250691012345678901234564 54P879211 3603110611710004 TUMINO NUANSA MEKARSARI B - 1 / 15 RT 004/006 KA 3538 XCBIRU 001SEPEDA MOTOR R2YAMAHA 54P (CAST WHEEL) AT 20132020090920210909000000000000000000000000000000154000000000000000000000035000000000000000000000000000000000000000000000189000SUKSES 01"
,
"aggregatorCode"
:
"W0216"
,
"amountInformation"
:
{
"billAmount"
:
"206500"
,
"feeAggregator"
:
"0"
,
"feeBJB"
:
"0"
,
"totalAmount"
:
"206500"
},
"amountTransaction"
:
"000000890000"
,
"billInformation"
:
{
"bills"
:
[{
"info"
:
"1000000108767"
},
{
"info"
:
"ALBUS DUMBLEDORE"
},
{
"info"
:
"BLACK MAGIC"
},
{
"info"
:
"BLACK MAGIC 101"
},
{
"info"
:
"890000"
},
{
"info"
:
"0"
},
{
"info"
:
"2019"
},
{
"info"
:
"0"
},
{
"info"
:
" "
},
{
"info"
:
" REG"
},
{
"info"
:
" "
}
]
},
"caCode"
:
"CA1830"
,
"currencyCode"
:
"360"
,
"destinationAccountNumber"
:
"0012199936360 "
,
"featureCode"
:
"009"
,
"localTransactionDate"
:
"0326"
,
"merchantType"
:
"6015"
,
"numberTransactionBank"
:
'1234567890'
,
"numberTransactionP"
:
'0987654321'
,
"pay"
:
"PAY"
,
"posEntryModeCode"
:
"110"
,
"primaryAccountNumber"
:
"622011888888888888"
,
"processingCode"
:
"521000"
,
"responseCode"
:
"00"
,
"sequenceNumber"
:
"000000502959"
,
"settlementDate"
:
"0326"
,
"sourceAccountNumber"
:
"0098889231001"
,
"systemTraceAuditNumber"
:
"502959"
,
"terminalAggregator"
:
{
"cardAcceptorName"
:
"NAEE "
,
"terminalIdentifierNumber"
:
"1 "
,
"terminalName"
:
"TERM "
},
"timeLocalTransaction"
:
"090210"
,
"track2Data"
:
"622011888888888888=9912?"
,
"transmissionDateTime"
:
"0107180458"
}
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