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 cf601db4
authored
Jul 31, 2019
by
solo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
live
1 parent
b7cbb306
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
src/agratek/api/merchant/views/merchan.py
src/agratek/api/merchant/views/odeo.py
src/agratek/api/merchant/views/merchan.py
View file @
cf601db
...
...
@@ -229,7 +229,7 @@ def purchase(request, data, **kwargs):
if
vendor_produk
.
produk
.
harga
<
total
:
total
+=
vendor_produk
.
produk
.
harga
prod
.
update
(
dict
(
total
=
result
[
"price"
]
))
prod
.
update
(
dict
(
total
=
total
))
# ar_invoice_det.status = 'status' in result and result["status"] or 'FAILED'
# if result["code"] == 9:
# ar_invoice_det.amt_buy = result["response"].total
...
...
src/agratek/api/merchant/views/odeo.py
View file @
cf601db
...
...
@@ -115,20 +115,21 @@ class Vendor(VendorClass):
if
resp
.
ok
:
# self.status = 1 # sukses
if
success
:
result
[
"code"
]
=
0
if
result
[
"status"
]
==
"SUCCESS"
:
self
.
status
=
1
#
result["code"] = 0
#
if result["status"]=="SUCCESS":
#
self.status = 1
elif
result
[
"status"
]
==
"PENDING"
:
self
.
status
=
-
1
elif
result
[
"status"
]
==
"GAGAL"
:
self
.
status
=
-
2
#
elif result["status"]=="PENDING":
#
self.status = -1
#
elif result["status"]=="GAGAL":
#
self.status = -2
data
=
"data"
in
result
and
result
[
"data"
]
or
None
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
parsd
=
self
.
pars_data
(
data
)
else
:
# parsd = self.pars_data(data)
...
...
@@ -223,8 +224,8 @@ class Vendor(VendorClass):
result
[
"status"
]
=
"PENDING"
self
.
status
=
0
#pending
elif
data
[
"rc"
]
==
"67"
:
result
[
"status"
]
=
"
DOUBLE
"
self
.
status
=
-
1
# Gagal Karena Pernah Transaksi
result
[
"status"
]
=
"
FAILED
"
self
.
status
=
-
2
# Gagal Karena Pernah Transaksi
else
:
self
.
status
=
1
...
...
@@ -233,6 +234,8 @@ class Vendor(VendorClass):
self
.
serial_number
=
'serial_number'
in
data
and
data
[
"serial_numner"
]
\
or
self
.
serial_number
result
[
"total"
]
=
data
[
"price"
]
if
"subscriber_id"
in
data
and
data
[
"subscriber_id"
]:
result
[
'id_pel'
]
=
data
[
"subscriber_id"
]
if
"name"
in
data
and
data
[
"name"
]:
...
...
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