Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Taufik Yulianto
/
esipkd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 95c13e13
authored
Dec 20, 2023
by
taufikyu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan qris, va model
1 parent
af0493f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
esipkd/models/bjb_qris.py
esipkd/models/bjb_va.py
esipkd/models/bjb_qris.py
View file @
95c13e1
...
...
@@ -131,7 +131,9 @@ class BJBQRIS(KodeModel, Base):
cek
=
cek_parameter
(
parameter
)
if
not
cek
:
return
False
expdate
=
datetime_from_str
(
values
[
'expired_date'
])
if
expdate
>
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)):
expdate
=
ymdhms
(
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)))
data
=
dict
(
client_type
=
values
[
'client_type'
],
invoice_no
=
str
(
values
[
'invoice_no'
]),
...
...
@@ -154,6 +156,34 @@ class BJBQRIS(KodeModel, Base):
pass
saved
=
cls
.
save
(
datava
)
return
saved
@classmethod
def
cancel_qris
(
cls
,
values
,
parameter
):
cek
=
cek_parameter
(
parameter
)
if
not
cek
:
return
False
row
=
cls
.
query
()
.
filter
(
cls
.
invoice_no
==
values
[
'invoice_no'
],
cls
.
status
==
'0'
)
.
all
()
qrisnum
=
[
r
.
va_number
for
r
in
row
]
data
=
dict
(
va_number
=
values
[
'va_number'
],
client_type
=
values
[
'client_type'
],
invoice_no
=
values
[
'invoice_no'
],
product_code
=
values
[
'product_code'
],
description
=
values
[
'description'
],
customer_name
=
values
[
'customer_name'
],
customer_email
=
values
[
'customer_email'
],
customer_phone
=
values
[
'customer_phone'
],
amount
=
str
(
values
[
'amount'
]),
va_type
=
'q'
)
datava
=
send_rpc
(
parameter
,
'cancel'
,
data
)
if
not
datava
:
return
False
datava
[
'status'
]
=
'4'
saved
=
DBSession
.
query
(
cls
)
.
filter
(
cls
.
va_number
.
in_
(
qrisnum
))
.
\
update
({
cls
.
status
:
'4'
},
synchronize_session
=
'fetch'
)
return
saved
def
send_rpc
(
parameter
,
method
,
data
):
headers
=
json_rpc_header
(
parameter
[
'bjbqris_user'
],
parameter
[
'bjbqris_key'
])
...
...
esipkd/models/bjb_va.py
View file @
95c13e1
...
...
@@ -118,7 +118,9 @@ class BJBVA(KodeModel, Base):
cek
=
cek_parameter
(
parameter
)
if
not
cek
:
return
False
expdate
=
datetime_from_str
(
values
[
'expired_date'
])
if
expdate
>
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)):
expdate
=
ymdhms
(
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)))
data
=
dict
(
client_type
=
values
[
'client_type'
],
invoice_no
=
values
[
'invoice_no'
],
...
...
@@ -150,6 +152,9 @@ class BJBVA(KodeModel, Base):
if
'expired_date'
in
values
and
isinstance
(
values
[
'expired_date'
],
datetime
):
values
[
'expired_date'
]
=
ymdhms
(
values
[
'expired_date'
])
expdate
=
datetime_from_str
(
values
[
'expired_date'
])
if
expdate
>
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)):
expdate
=
ymdhms
(
datetime
.
combine
(
date
.
today
(),
time
(
20
,
59
,
59
)))
data
=
dict
(
va_number
=
values
[
'va_number'
],
invoice_no
=
values
[
'invoice_no'
],
...
...
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