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 0bb582cf
authored
Jul 31, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ar_invoce
1 parent
8dab2fbb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
src/agratek/api/merchant/views/odeo.py
src/agratek/api/merchant/views/vendor.py
src/agratek/api/merchant/views/odeo.py
View file @
0bb582c
...
...
@@ -94,11 +94,15 @@ class Vendor(VendorClass):
self
.
save_log
(
'inquiry'
)
return
parsd
def
gagal_transaksi
(
self
):
def
gagal_transaksi
(
self
,
code
):
if
code
==
400
:
self
.
status
=
-
3
else
:
self
.
status
=
-
2
parsd
=
dict
(
status
=
"FAILED"
,
code
=
-
2
,
code
=
code
,
message
=
"Gagal Transaksi"
)
self
.
result
=
parsd
...
...
@@ -132,7 +136,7 @@ class Vendor(VendorClass):
data
=
"data"
in
result
and
result
[
"data"
]
or
None
# cel rc status
if
not
data
:
return
self
.
gagal_transaksi
()
return
self
.
gagal_transaksi
(
500
)
if
"rc"
in
data
:
parsd
[
"code"
]
=
int
(
data
[
"rc"
])
...
...
@@ -164,7 +168,8 @@ class Vendor(VendorClass):
return
parsd
else
:
# BAD REQUEST
return
self
.
gagal_transaksi
()
return
self
.
gagal_transaksi
(
resp
.
status_code
)
def
advice
(
self
):
...
...
src/agratek/api/merchant/views/vendor.py
View file @
0bb582c
...
...
@@ -192,9 +192,14 @@ def proses_odeo(request):
if
status
==
"COMPLETED"
:
order
.
status
=
1
else
:
order
.
status
=
-
1
order
.
status
=
-
2
order
.
notify
=
data
flush_row
(
order
)
#todo: add to customer notify table
#todo: create cron for notify
#proses jika status 1 notify ada isinya tapi belum ada field result
#todo: create cron torecurring order to other vendor
#jika status = -2 proses vendor yang lain
#
# customer = Partner.query_id(order.customer_id).first()
# if customer and customer.website:
...
...
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