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 6d464ccb
authored
Aug 30, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
-vsi pln post
1 parent
29e5c925
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
src/agratek/api/merchant/views/vsi/pln_post.py
src/agratek/api/merchant/views/vsi/pln_post.py
View file @
6d464cc
...
@@ -156,25 +156,26 @@ class Vendor(VendorClass):
...
@@ -156,25 +156,26 @@ class Vendor(VendorClass):
except
requests
.
exceptions
.
RequestException
as
e
:
except
requests
.
exceptions
.
RequestException
as
e
:
data
=
dict
(
message
=
e
.
strerror
,
data
=
dict
(
message
=
e
.
strerror
,
code
=
e
.
errno
)
code
=
e
.
errno
)
return
self
.
s
ave_response
(
data
)
return
self
.
s
et_pending
(
data
)
if
resp
and
resp
.
ok
:
if
resp
and
resp
.
ok
:
data
=
dict
(
xmltodict
.
parse
(
resp
.
text
)[
"root"
])
data
=
dict
(
xmltodict
.
parse
(
resp
.
text
)[
"root"
])
self
.
response
=
data
self
.
response
=
data
data
=
self
.
pars_data
(
data
)
data
=
self
.
pars_data
(
data
)
self
.
result
=
data
return
self
.
set_success
(
data
)
elif
resp
:
elif
resp
:
data
=
dict
(
message
=
resp
.
text
,
data
=
dict
(
message
=
resp
.
text
,
code
=
resp
.
status_code
)
code
=
resp
.
status_code
)
self
.
response
=
data
self
.
response
=
data
return
self
.
set_failed
(
data
)
else
:
else
:
data
=
dict
(
message
=
"No Response From Biller "
,
data
=
dict
(
message
=
"No Response From Biller "
,
code
=
500
)
code
=
500
)
return
self
.
s
ave_response
(
data
)
return
self
.
s
et_failed
(
data
)
self
.
result
=
data
return
self
.
save_response
(
data
)
def
payment
(
self
):
def
payment
(
self
):
params
=
self
.
get_params
(
cmd
=
'PAY'
,
modul
=
'pln'
)
params
=
self
.
get_params
(
cmd
=
'PAY'
,
modul
=
'pln'
)
...
@@ -193,13 +194,27 @@ class Vendor(VendorClass):
...
@@ -193,13 +194,27 @@ class Vendor(VendorClass):
data
=
dict
(
code
=
resp
.
status_code
,
data
=
dict
(
code
=
resp
.
status_code
,
message
=
resp
.
text
)
message
=
resp
.
text
)
self
.
response
=
data
self
.
response
=
data
# except requests.exceptions.Timeout as errt:
# message = "Biller Timeout Transaksi will be retry"
# self.status = -1
# return self.set_pending(data, message=message)
# except requests.exceptions.RequestException as e:
# message = "Biller Error Transaksi will be retry"
# self.status = -1
# return self.set_pending(data, message=message)
except
:
except
:
data
=
dict
(
code
=
500
,
self
.
status
=
0
message
=
"No Response From Biller"
)
#self.response = dict(code=resp.status_code, message=resp.text)
log
.
info
(
"Payment Response:
%
s"
%
(
self
.
response
))
return
self
.
set_pending
()
self
.
amt_buy
=
"harga"
in
data
and
data
[
"harga"
]
or
self
.
amt_buy
self
.
vend_inv_no
=
"ref_num"
in
data
and
data
[
"ref_num"
]
or
self
.
vend_inv_no
data
=
self
.
pars_data
(
self
.
response
)
return
self
.
set_success
(
data
)
data
=
self
.
pars_data
(
data
)
self
.
save_log
(
'payment'
)
return
data
def
advice
(
self
):
def
advice
(
self
):
params
=
self
.
get_params
(
cmd
=
'ADV'
,
modul
=
'pln'
)
params
=
self
.
get_params
(
cmd
=
'ADV'
,
modul
=
'pln'
)
...
...
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