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 d6a7e8e5
authored
Aug 05, 2019
by
solo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
live
1 parent
47bda1d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
src/agratek/api/merchant/views/odeo/__init__.py
src/agratek/api/merchant/views/vsi/pulsa.py
src/agratek/api/merchant/views/odeo/__init__.py
View file @
d6a7e8e
...
...
@@ -145,7 +145,7 @@ class Vendor(VendorClass):
except
:
resp
=
None
if
not
resp
:
if
resp
is
None
:
self
.
status
=
0
return
self
.
set_pending
(
parsd
)
#todo: dibuat seolah menjadi belum di transaksikan
...
...
@@ -154,7 +154,6 @@ class Vendor(VendorClass):
result
=
json
.
loads
(
resp
.
text
)
self
.
response
=
result
log
.
info
(
"Payment Response:
%
s"
%
self
.
response
)
except
:
result
=
resp
.
text
self
.
response
=
result
...
...
@@ -192,14 +191,21 @@ class Vendor(VendorClass):
elif
resp
.
status_code
==
400
:
self
.
status
=
-
3
data
=
"data"
in
result
and
result
[
"data"
]
or
None
message
=
""
if
data
and
"error"
in
data
:
msg
=
data
[
"error"
][
0
]
if
data
and
"error
s
"
in
data
:
msg
=
data
[
"error
s
"
][
0
]
pos
=
msg
.
find
(
"Sisa saldo"
)
message
=
pos
>
-
1
and
msg
[:
pos
]
or
msg
pos
=
message
.
find
(
"SN: "
)
sn
=
""
if
pos
>-
1
:
sn_spl
=
message
[
pos
:]
.
split
(
" "
)
sn
=
len
(
sn_spl
)
>
1
and
sn_spl
[
1
]
or
""
parsd
[
"serial_number"
]
=
sn
return
self
.
set_failed
(
parsd
,
message
=
message
)
elif
resp
.
status_code
==
401
:
...
...
src/agratek/api/merchant/views/vsi/pulsa.py
View file @
d6a7e8e
...
...
@@ -98,7 +98,6 @@ class Vendor(VendorClass):
self
.
response
=
dict
(
code
=
result
.
status_code
,
message
=
result
.
text
)
log
.
info
(
"Payment Response:
%
s"
%
(
self
.
response
))
return
self
.
set_pending
(
data
,
message
=
result
.
text
)
except
requests
.
exceptions
.
RequestException
as
e
:
self
.
status
=
0
return
self
.
set_pending
(
data
,
message
=
e
.
strerror
)
...
...
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