Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Kunto
/
backoffice
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 f7a10959
authored
Jul 30, 2019
by
solo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
live
1 parent
cc26715f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
src/agratek/api/merchant/views/odeo.py
src/agratek/api/merchant/views/vendor.py
src/agratek/api/merchant/views/odeo.py
View file @
f7a1095
...
...
@@ -115,6 +115,7 @@ class Vendor(VendorClass):
if
resp
.
ok
:
# self.status = 1 # sukses
if
success
:
result
[
"code"
]
=
0
if
result
[
"status"
]
==
"SUCCESS"
:
self
.
status
=
1
...
...
@@ -127,6 +128,7 @@ class Vendor(VendorClass):
if
data
:
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
None
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
=
result
else
:
# parsd = self.pars_data(data)
...
...
@@ -148,12 +150,12 @@ class Vendor(VendorClass):
message
=
"Other Error"
,
status
=
"FAILED"
)
if
'ref_no'
in
parsd
:
self
.
vend_inv_no
=
parsd
[
"ref_no"
]
#
if 'ref_no' in parsd:
#
self.vend_inv_no = parsd["ref_no"]
self
.
save_log
(
'payment'
)
txt
=
"ODEO PARSING: {d}"
.
format
(
d
=
json
.
dumps
(
parsd
))
log
.
info
(
txt
)
#
txt = "ODEO PARSING: {d}".format(d=json.dumps(parsd))
#
log.info(txt)
return
parsd
def
advice
(
self
):
...
...
src/agratek/api/merchant/views/vendor.py
View file @
f7a1095
...
...
@@ -20,7 +20,7 @@ from pyramid.httpexceptions import HTTPFound
from
pyramid.view
import
view_config
from
.
import
BaseView
# , save_file_upload
from
..models
import
(
DBSession
,
flush_row
,
Partner
,
PartnerProduk
,
H2hArInvoice
)
from
..models
import
(
DBSession
,
flush_row
,
Partner
,
PartnerProduk
,
H2hArInvoice
Det
)
from
..models
import
(
Produk
,
ProdukKategori
)
from
..tools
import
(
btn_next
,
date_from_str
,
get_settings
,
btn_reset
,
btn_inquiry
,
btn_advice
,
btn_payment
)
...
...
@@ -182,9 +182,9 @@ def proses_odeo(request):
log
.
info
(
"Signature Vendor Different"
)
log
.
info
(
"local
%
s, vendor
%
s"
%
(
signature
,
data
[
"signature"
]))
return
dict
(
error
=
"Signature Different"
)
order
=
H2hArInvoice
.
query
()
\
.
filter
(
H2hArInvoice
.
vendor_id
==
partner
.
id
,
H2hArInvoice
.
vend_inv_no
==
str
(
order_id
))
.
first
()
order
=
H2hArInvoice
Det
.
query
()
\
.
filter
(
H2hArInvoice
Det
.
vendor_id
==
partner
.
id
,
H2hArInvoice
Det
.
vend_inv_no
==
str
(
order_id
))
.
first
()
if
order
:
if
status
==
"COMPLETED"
:
...
...
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