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 d01a0791
authored
Aug 03, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
VSI
1 parent
2b576d2f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
src/agratek/api/merchant/views/merchant.py
src/agratek/api/merchant/views/odeo/__init__.py
src/agratek/api/merchant/views/vsi_pulsa.py
src/agratek/api/merchant/views/merchant.py
View file @
d01a079
...
...
@@ -25,7 +25,7 @@ def build_request(typ, vendor_produk, partner_log=None):
if
cls
:
data
=
cls
()
result
=
data
# dict(data=data
)
log
.
info
(
"Build Req: mod
%
s rslt:
%
s"
%
(
vendor_produk
.
modules
,
data
)
)
result
[
"f_result"
]
=
cls_module
.
result
result
[
"f_request"
]
=
cls_module
.
request
result
[
"f_response"
]
=
cls_module
.
response
...
...
src/agratek/api/merchant/views/odeo/__init__.py
View file @
d01a079
...
...
@@ -184,10 +184,9 @@ class Vendor(VendorClass):
self
.
serial_number
=
'serial_number'
in
data
and
data
[
"serial_numner"
]
\
or
self
.
serial_number
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
{}
self
.
vend_inv_no
=
"order_id"
in
data
and
data
[
"order_id"
]
or
None
if
not
inq
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
parsd
[
"total"
]
=
self
.
amt_buy
else
:
self
.
amt_buy
=
"price"
in
data
and
data
[
"price"
]
or
0
...
...
@@ -196,6 +195,7 @@ class Vendor(VendorClass):
parsd
[
"discount"
]
=
inq
[
"discount"
]
self
.
result
=
parsd
log
.
info
(
"ODEO Payment Result:
%
s"
%
self
.
result
)
self
.
save_log
(
'payment'
)
return
parsd
...
...
src/agratek/api/merchant/views/vsi_pulsa.py
View file @
d01a079
...
...
@@ -104,12 +104,13 @@ class Vendor(VendorClass):
partner_id
=
self
.
invoice_det
.
ar_invoice
.
customer_id
discount
=
PartnerProduk
.
get_discount
(
partner_id
,
product_id
)
harga
=
self
.
vendor_produk
.
produk
.
harga
self
.
status
=
1
if
not
harga
:
raise
JsonRpcError
()
else
:
discount
=
0
harga
=
0
self
.
status
=
-
1
result
=
dict
(
status
=
"status"
in
data
and
data
[
"status"
]
or
"FAILED"
,
...
...
@@ -118,9 +119,9 @@ class Vendor(VendorClass):
and
(
data
[
"rcm"
]
==
"00000"
and
"Sukses"
or
data
[
"rcm"
])
\
or
"PENDING"
,
serial_number
=
"serialnumber"
in
data
and
data
[
"serialnumber"
]
or
""
,
subtotal
=
harga
,
discount
=
discount
,
total
=
harga
-
discount
subtotal
=
int
(
harga
)
,
discount
=
int
(
discount
)
,
total
=
int
(
harga
-
discount
)
)
return
result
...
...
@@ -162,7 +163,8 @@ class Vendor(VendorClass):
data
=
xmltodict
.
parse
(
result
.
text
)[
"root"
]
self
.
response
=
data
else
:
data
=
dict
(
error
=
result
.
status_code
)
data
=
dict
(
code
=
result
.
status_code
,
message
=
result
.
text
)
except
requests
.
exceptions
.
RequestException
as
e
:
data
=
dict
(
code
=
e
.
errno
,
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