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 22368f54
authored
Sep 13, 2019
by
Tatang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
np-va
1 parent
e57ca22c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
src/agratek/api/merchant/views/np/__init__.py
src/agratek/api/merchant/views/np/__init__.py
View file @
22368f5
...
...
@@ -16,27 +16,37 @@ class Vendor(VendorClass): # VendorClass
def
__init__
(
self
,
vendor_produk
,
invoice_det
,
**
kwargs
):
VendorClass
.
__init__
(
self
,
vendor_produk
,
invoice_det
=
invoice_det
,
**
kwargs
)
settings
=
get_settings
()
self
.
v_produk_kd
=
vendor_produk
.
kode
self
.
bank_cd
,
self
.
pay_method
=
self
.
v_produk_kd
.
split
(
'-'
)
self
.
mid
=
'np_mid'
in
settings
and
settings
[
'np_mid'
]
or
None
# khusus payloan, imidnya tersendiri. jika tdk diset, maka disamakan dgn yg lain
# tambahkan setting np_loan_mid di ini file
if
self
.
pay_method
==
'06'
and
'np_loan_mid'
in
settings
and
settings
[
'np_loan_mid'
]:
self
.
mid
=
settings
[
'np_load_mid'
]
self
.
key
=
'np_key'
in
settings
and
settings
[
'np_key'
]
or
None
self
.
url
=
'np_url'
in
settings
and
settings
[
'np_url'
]
or
None
self
.
callback_url
=
"{}/api/vendor/np/callback"
.
format
(
get_host
())
self
.
notify_url
=
"{}/api/vendor/np/notify"
.
format
(
get_host
())
key
=
":"
.
join
([
self
.
mid
,
self
.
key
])
.
encode
()
self
.
auth
=
base64
.
b64encode
(
key
)
.
decode
()
self
.
v_produk_kd
=
vendor_produk
.
kode
self
.
ccard
=
"ccard"
in
kwargs
and
kwargs
[
"ccard"
]
or
None
self
.
cp
=
"cp"
in
kwargs
and
kwargs
[
"cp"
]
or
None
self
.
cvs
=
"cvs"
in
kwargs
and
kwargs
[
"cvs"
]
or
None
self
.
va
=
"va"
in
kwargs
and
kwargs
[
"va"
]
or
None
self
.
pl
=
"pl"
in
kwargs
and
kwargs
[
"pl"
]
or
None
customer
=
self
.
invoice_det
.
customer
if
customer
:
self
.
cust_kd
=
customer
.
kode
self
.
cust_inv_no
=
self
.
invoice_det
.
cust_inv_no
self
.
bank_cd
,
self
.
pay_method
=
self
.
v_produk_kd
.
split
(
'-'
)
if
self
.
pay_method
==
"02"
and
is_devel
():
self
.
mid
=
"VACTFOPEND"
# self.mid = "VACTFOPEND" # sama dgn yang lain
key
=
":"
.
join
([
self
.
mid
,
self
.
key
])
.
encode
()
self
.
auth
=
base64
.
b64encode
(
key
)
.
decode
()
...
...
@@ -164,10 +174,12 @@ class Vendor(VendorClass): # VendorClass
Nicepay
.
set
(
'vacctValidTm'
,
self
.
invoice_det
.
inv_valid_time
)
if
self
.
invoice_det
.
inv_cust_va
:
self
.
va_typ
=
'fixed'
Nicepay
.
set
(
'merFixAcctId'
,
self
.
invoice_det
.
inv_cust_va
)
# Nicepay.set('merFixAcctId', self.invoice_det.inv_cust_va)
else
:
self
.
va_typ
=
'float'
# Nicepay.set('merFixAcctId', '')
# merFixAcctId dikosongkan saja
Nicepay
.
set
(
'merFixAcctId'
,
''
)
# For CVS
...
...
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