Commit 22368f54 by Tatang

np-va

1 parent e57ca22c
......@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!