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 685979f2
authored
Jul 24, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
pars odeo
1 parent
6a9c70e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
src/agratek/api/merchant/views/odeo.py
src/agratek/api/merchant/views/odeo.py
View file @
685979f
...
@@ -68,15 +68,22 @@ class Vendor(VendorClass):
...
@@ -68,15 +68,22 @@ class Vendor(VendorClass):
except
:
except
:
content
=
resp
.
text
content
=
resp
.
text
self
.
status
=
1
if
resp
.
ok
:
if
resp
.
ok
:
result
=
content
self
.
status
=
1
# sukses
result
=
json
.
loads
(
content
)
parsd
=
self
.
pars_data
(
result
)
elif
resp
.
status_code
==
400
:
self
.
status
=
-
3
parsd
=
dict
(
code
=
resp
.
status_code
,
message
=
resp
.
text
)
else
:
else
:
result
=
dict
(
code
=
resp
.
status_code
,
self
.
status
=
-
4
message
=
resp
.
text
)
parsd
=
dict
(
code
=
500
,
message
=
"Other Error"
)
self
.
response
=
content
self
.
response
=
content
self
.
save_log
(
'inquiry'
)
self
.
save_log
(
'inquiry'
)
return
self
.
pars_data
(
result
)
return
parsd
def
payment
(
self
):
def
payment
(
self
):
if
not
self
.
v_produk_kd
or
not
self
.
bill_no
:
if
not
self
.
v_produk_kd
or
not
self
.
bill_no
:
...
@@ -96,16 +103,21 @@ class Vendor(VendorClass):
...
@@ -96,16 +103,21 @@ class Vendor(VendorClass):
content
=
resp
.
text
content
=
resp
.
text
if
resp
.
ok
:
if
resp
.
ok
:
result
=
content
self
.
status
=
1
# sukses
self
.
status
=
1
result
=
json
.
loads
(
content
)
parsd
=
self
.
pars_data
(
result
)
elif
resp
.
status_code
==
400
:
self
.
status
=
-
3
parsd
=
dict
(
code
=
resp
.
status_code
,
message
=
resp
.
text
)
else
:
else
:
self
.
status
=
-
1
self
.
status
=
-
4
result
=
dict
(
code
=
resp
.
status_code
,
parsd
=
dict
(
code
=
500
,
message
=
resp
.
text
)
message
=
"Other Error"
)
self
.
response
=
content
self
.
response
=
content
self
.
save_log
(
'payment'
)
self
.
save_log
(
'payment'
)
return
self
.
pars_data
(
result
)
return
parsd
def
advice
(
self
):
def
advice
(
self
):
if
not
self
.
v_produk_kd
or
not
self
.
bill_no
or
not
self
.
partner_log_id
:
if
not
self
.
v_produk_kd
or
not
self
.
bill_no
or
not
self
.
partner_log_id
:
...
@@ -135,12 +147,17 @@ class Vendor(VendorClass):
...
@@ -135,12 +147,17 @@ class Vendor(VendorClass):
if
resp
.
ok
:
if
resp
.
ok
:
self
.
status
=
1
# sukses
self
.
status
=
1
# sukses
result
=
json
.
loads
(
content
)
result
=
json
.
loads
(
content
)
else
:
parsd
=
self
.
pars_data
(
result
)
self
.
status
=
-
1
elif
resp
.
status_code
==
400
:
self
.
status
=
-
3
result
=
dict
(
code
=
resp
.
status_code
,
result
=
dict
(
code
=
resp
.
status_code
,
message
=
resp
.
text
)
message
=
resp
.
text
)
else
:
self
.
status
=
-
4
parsd
=
dict
(
code
=
500
,
message
=
"Other Error"
)
self
.
response
=
content
self
.
response
=
content
parsd
=
self
.
pars_data
(
result
)
self
.
save_log
(
'advice'
)
self
.
save_log
(
'advice'
)
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