Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
iso8583
/
bjb-samsat-banten
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 996a843f
authored
Mar 31, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
script test dan log db
1 parent
7a297605
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
28 deletions
opensipkd/iso8583/bjb/samsat/banten/doc.py
opensipkd/iso8583/bjb/samsat/models.py
opensipkd/iso8583/bjb/samsat/banten/doc.py
View file @
996a843
...
@@ -465,24 +465,21 @@ class Doc(Transaction):
...
@@ -465,24 +465,21 @@ class Doc(Transaction):
return
return
def
reversal_response_
(
self
):
def
reversal_response_
(
self
):
self
.
invoice_id_raw
=
self
.
from_iso
.
get_invoice_id_raw
()[:
16
]
invoice_id_raw
=
self
.
from_iso
.
get_invoice_id_raw
()[:
16
]
ntb
=
self
.
from_iso
.
get_ntb
()
ntb
=
self
.
from_iso
.
get_ntb
()
pay
=
None
q
=
DBSession
.
query
(
SamsatPayment
)
.
filter_by
(
#q = self.db_profile.query(models.IsoPayment).filter_by(
nomor_bayar
=
invoice_id_raw
.
strip
(),
# invoice_no=self.invoice_id_raw[:16].strip(),
ntb
=
ntb
)
# # nik=self.invoice_id_raw[16:].strip(),
# ntb=ntb)
pay
=
q
.
first
()
if
not
pay
:
# pay = q.first()
return
self
.
ack_payment_not_found
()
# if not pay:
# return self.ack_payment_not_found()
# self.invoice_id_raw = self.from_iso.get_invoice_id_raw()
q
=
DBSession
.
query
(
SamsatReversal
)
.
filter_by
(
id
=
pay
.
id
)
# self.invoice_id_raw = ''.join([self.invoice_profile['Nomor Bayar'].strip(),
rev
=
q
.
first
()
# self.invoice_profile['Nomor Identitas'].strip()])
if
rev
:
#q = self.db_profile.query(models.IsoReversal).filter_by(id=pay.id)
return
self
.
ack_reversal_done
()
#rev = q.first()
#if rev:
# return self.ack_reversal_done()
result
=
self
.
execute_reversal
()
result
=
self
.
execute_reversal
()
...
@@ -492,9 +489,8 @@ class Doc(Transaction):
...
@@ -492,9 +489,8 @@ class Doc(Transaction):
return
self
.
save_reversal
(
pay
,
result
[
'ntp'
])
return
self
.
save_reversal
(
pay
,
result
[
'ntp'
])
def
reversal_response
(
self
):
def
reversal_response
(
self
):
self
.
reversal_response_
()
try
:
try
:
pass
self
.
reversal_response_
()
except
:
except
:
self
.
ack_other
(
'Ada kesalahan yang belum dipahami.'
)
self
.
ack_other
(
'Ada kesalahan yang belum dipahami.'
)
f
=
StringIO
()
f
=
StringIO
()
...
@@ -503,14 +499,14 @@ class Doc(Transaction):
...
@@ -503,14 +499,14 @@ class Doc(Transaction):
f
.
close
()
f
.
close
()
def
save_reversal
(
self
,
pay
,
ntpd
):
def
save_reversal
(
self
,
pay
,
ntpd
):
#rev = models.Iso
Reversal()
rev
=
Samsat
Reversal
()
#
rev.id = pay.id
rev
.
id
=
pay
.
id
#
rev.iso_request = self.from_iso.raw.upper()
rev
.
iso_request
=
self
.
from_iso
.
raw
.
upper
()
rev
.
tgl
=
self
.
from_iso
.
get_transaction_datetime
()
# todo: seharusnya trnsaction_date_time
rev
.
ntp
=
ntpd
#rev.tgl = self.from_iso.get_transaction_date(
)
DBSession
.
add
(
rev
)
#rev.ntp = ntpd
DBSession
.
flush
()
#self.db_profile.commit(rev
)
transaction
.
commit
(
)
self
.
ack
()
self
.
ack
()
###################
###################
...
...
opensipkd/iso8583/bjb/samsat/models.py
View file @
996a843
...
@@ -58,4 +58,5 @@ class SamsatReversal(Base, BaseModel):
...
@@ -58,4 +58,5 @@ class SamsatReversal(Base, BaseModel):
id
=
Column
(
Integer
,
ForeignKey
(
SamsatPayment
.
id
),
nullable
=
False
,
id
=
Column
(
Integer
,
ForeignKey
(
SamsatPayment
.
id
),
nullable
=
False
,
primary_key
=
True
)
primary_key
=
True
)
ntp
=
Column
(
String
(
32
),
nullable
=
False
)
ntp
=
Column
(
String
(
32
),
nullable
=
False
)
tgl_reversal
=
Column
(
DateTime
(
timezone
=
False
))
iso_request
=
Column
(
Text
)
tgl
=
Column
(
DateTime
(
timezone
=
False
))
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