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 69c2295e
authored
Aug 30, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
-vsi pln post
1 parent
9397fc9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
src/agratek/api/merchant/views/vsi/pln_post.py
src/agratek/api/merchant/views/vsi/pln_pre.py
src/agratek/api/merchant/views/vsi/pln_post.py
View file @
69c2295
src/agratek/api/merchant/views/vsi/pln_pre.py
View file @
69c2295
...
...
@@ -58,7 +58,11 @@ class Vendor(VendorClass):
power
=
"tarifdaya"
in
data
and
data
[
"tarifdaya"
]
.
split
(
"/"
)
or
[
""
]
power
=
len
(
power
)
>
1
and
power
[
-
1
:][
0
]
or
power
[
0
]
product_id
=
self
.
invoice_det
.
produk
.
id
if
hasattr
(
self
.
invoice_det
,
"customer_id"
):
partner_id
=
self
.
invoice_det
.
customer_id
else
:
partner_id
=
self
.
invoice_det
.
h2h_ar_invoice
.
customer_id
discount
=
PartnerProduk
.
get_discount
(
partner_id
,
product_id
)
admin
=
self
.
vendor_produk
.
produk
.
harga
harga
=
"nominal"
in
data
and
data
[
"nominal"
]
or
0
...
...
@@ -80,7 +84,8 @@ class Vendor(VendorClass):
message
=
"GAGAL"
else
:
message
=
"PENDING"
return
dict
(
code
=
code
,
message
=
message
)
return
{
"code"
:
code
,
...
...
@@ -129,15 +134,18 @@ class Vendor(VendorClass):
data
=
dict
(
message
=
resp
.
text
,
code
=
resp
.
status_code
)
self
.
response
=
data
log
.
info
(
"R
E
sponse:
%
s"
%
data
)
log
.
info
(
"R
e
sponse:
%
s"
%
data
)
except
requests
.
exceptions
.
RequestException
as
e
:
data
=
dict
(
message
=
e
.
strerror
,
code
=
e
.
errno
)
return
self
.
s
ave_result
(
data
)
return
self
.
s
et_failed
(
)
data
=
self
.
pars_data
(
data
)
return
self
.
save_result
(
data
)
if
data
[
"code"
]
!=
0
:
return
self
.
set_failed
()
return
self
.
set_success
(
data
)
def
payment
(
self
):
params
=
self
.
get_params
(
cmd
=
'PAY'
,
modul
=
'PRE'
)
...
...
@@ -188,6 +196,8 @@ class Vendor(VendorClass):
message
=
"No Response From Biller"
)
data
=
self
.
pars_data
(
data
)
if
data
[
"code"
]
!=
0
:
return
self
.
set_failed
()
self
.
result
=
data
self
.
save_log
(
'advice'
)
return
data
return
self
.
set_success
(
data
)
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