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 60870575
authored
Jul 31, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
auto-push
1 parent
5d678412
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
src/agratek/api/merchant/views/odeo.py
src/agratek/api/merchant/views/odeo.py
View file @
6087057
...
@@ -133,14 +133,20 @@ class Vendor(VendorClass):
...
@@ -133,14 +133,20 @@ class Vendor(VendorClass):
number
=
self
.
id_pel
number
=
self
.
id_pel
)
)
)
)
self
.
request
=
params
self
.
request
=
params
log
.
info
(
"ODEO Payment Request:
%
s"
%
self
.
request
)
log
.
info
(
"ODEO Payment Request:
%
s"
%
self
.
request
)
self
.
save_log
(
"payment"
)
self
.
save_log
(
"payment"
)
inq
=
None
if
self
.
vendor_produk
.
produk
.
kategori
==
"e-payment"
:
inq
=
self
.
inquiry
()
resp
=
self
.
request_post
(
params
,
'/prepaid/purchase'
)
resp
=
self
.
request_post
(
params
,
'/prepaid/purchase'
)
try
:
try
:
result
=
json
.
loads
(
resp
.
text
)
result
=
json
.
loads
(
resp
.
text
)
except
:
except
:
result
=
resp
and
resp
.
text
or
""
result
=
resp
and
resp
.
text
or
{}
self
.
response
=
result
self
.
response
=
result
log
.
info
(
"ODEO Payment Response:
%
s"
%
self
.
response
)
log
.
info
(
"ODEO Payment Response:
%
s"
%
self
.
response
)
...
@@ -148,9 +154,10 @@ class Vendor(VendorClass):
...
@@ -148,9 +154,10 @@ class Vendor(VendorClass):
# 0200 ok
# 0200 ok
# 0400 bad request
# 0400 bad request
# 0401 auth error
# 0401 auth error
parsd
=
{}
parsd
=
{}
if
resp
.
status_code
==
200
:
# 0200
if
resp
.
status_code
==
200
and
type
(
result
)
is
dict
:
# 0200
data
=
"data"
in
result
and
result
[
"data"
]
or
None
data
=
"data"
in
result
and
result
[
"data"
]
or
{}
# cel rc status
# cel rc status
if
not
data
:
if
not
data
:
return
self
.
gagal_transaksi
(
500
)
return
self
.
gagal_transaksi
(
500
)
...
@@ -176,10 +183,17 @@ class Vendor(VendorClass):
...
@@ -176,10 +183,17 @@ class Vendor(VendorClass):
self
.
serial_number
=
'serial_number'
in
data
and
data
[
"serial_numner"
]
\
self
.
serial_number
=
'serial_number'
in
data
and
data
[
"serial_numner"
]
\
or
self
.
serial_number
or
self
.
serial_number
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
None
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
{}
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
if
inq
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
[
"total"
]
=
self
.
amt_buy
else
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
[
"total"
]
=
inq
[
"total"
]
parsd
[
"subtotal"
]
=
inq
[
"subtotal"
]
parsd
[
"discount"
]
=
inq
[
"discount"
]
parsd
[
"total"
]
=
self
.
amt_buy
self
.
result
=
parsd
self
.
result
=
parsd
self
.
save_log
(
'payment'
)
self
.
save_log
(
'payment'
)
return
parsd
return
parsd
...
...
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