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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 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
...
@@ -171,7 +171,7 @@ class Vendor(VendorClass):
...
@@ -171,7 +171,7 @@ class Vendor(VendorClass):
data
=
self
.
pars_data
(
data
)
data
=
self
.
pars_data
(
data
)
if
data
[
"code"
]
!=
0
:
if
data
[
"code"
]
!=
0
:
return
self
.
set_failed
()
return
self
.
set_failed
()
self
.
result
=
data
self
.
result
=
data
return
self
.
set_success
(
data
)
return
self
.
set_success
(
data
)
...
...
src/agratek/api/merchant/views/vsi/pln_pre.py
View file @
69c2295
...
@@ -58,7 +58,11 @@ class Vendor(VendorClass):
...
@@ -58,7 +58,11 @@ class Vendor(VendorClass):
power
=
"tarifdaya"
in
data
and
data
[
"tarifdaya"
]
.
split
(
"/"
)
or
[
""
]
power
=
"tarifdaya"
in
data
and
data
[
"tarifdaya"
]
.
split
(
"/"
)
or
[
""
]
power
=
len
(
power
)
>
1
and
power
[
-
1
:][
0
]
or
power
[
0
]
power
=
len
(
power
)
>
1
and
power
[
-
1
:][
0
]
or
power
[
0
]
product_id
=
self
.
invoice_det
.
produk
.
id
product_id
=
self
.
invoice_det
.
produk
.
id
partner_id
=
self
.
invoice_det
.
h2h_ar_invoice
.
customer_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
)
discount
=
PartnerProduk
.
get_discount
(
partner_id
,
product_id
)
admin
=
self
.
vendor_produk
.
produk
.
harga
admin
=
self
.
vendor_produk
.
produk
.
harga
harga
=
"nominal"
in
data
and
data
[
"nominal"
]
or
0
harga
=
"nominal"
in
data
and
data
[
"nominal"
]
or
0
...
@@ -80,7 +84,8 @@ class Vendor(VendorClass):
...
@@ -80,7 +84,8 @@ class Vendor(VendorClass):
message
=
"GAGAL"
message
=
"GAGAL"
else
:
else
:
message
=
"PENDING"
message
=
"PENDING"
return
dict
(
code
=
code
,
message
=
message
)
return
{
return
{
"code"
:
code
,
"code"
:
code
,
...
@@ -129,15 +134,18 @@ class Vendor(VendorClass):
...
@@ -129,15 +134,18 @@ class Vendor(VendorClass):
data
=
dict
(
message
=
resp
.
text
,
data
=
dict
(
message
=
resp
.
text
,
code
=
resp
.
status_code
)
code
=
resp
.
status_code
)
self
.
response
=
data
self
.
response
=
data
log
.
info
(
"R
E
sponse:
%
s"
%
data
)
log
.
info
(
"R
e
sponse:
%
s"
%
data
)
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_result
(
data
)
return
self
.
s
et_failed
(
)
data
=
self
.
pars_data
(
data
)
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
):
def
payment
(
self
):
params
=
self
.
get_params
(
cmd
=
'PAY'
,
modul
=
'PRE'
)
params
=
self
.
get_params
(
cmd
=
'PAY'
,
modul
=
'PRE'
)
...
@@ -188,6 +196,8 @@ class Vendor(VendorClass):
...
@@ -188,6 +196,8 @@ class Vendor(VendorClass):
message
=
"No Response From Biller"
)
message
=
"No Response From Biller"
)
data
=
self
.
pars_data
(
data
)
data
=
self
.
pars_data
(
data
)
if
data
[
"code"
]
!=
0
:
return
self
.
set_failed
()
self
.
result
=
data
self
.
result
=
data
self
.
save_log
(
'advice'
)
return
self
.
set_success
(
data
)
return
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