Commit ebf37c00 by solo

a

1 parent a1b7ce15
...@@ -19,7 +19,7 @@ class Vendor(VendorClass): ...@@ -19,7 +19,7 @@ class Vendor(VendorClass):
self.key = 'odeo_key' in settings and settings['odeo_key'] or None self.key = 'odeo_key' in settings and settings['odeo_key'] or None
self.url = 'odeo_url' in settings and settings['odeo_url'] or None self.url = 'odeo_url' in settings and settings['odeo_url'] or None
key = ":".join([self.mid, self.key]).encode() key = ":".join([self.mid, self.key]).encode()
self.auth = base64.b64encode(key) self.auth = base64.b64encode(key).decode()
def request_post(self, params, url=None): def request_post(self, params, url=None):
...@@ -43,7 +43,7 @@ class Vendor(VendorClass): ...@@ -43,7 +43,7 @@ class Vendor(VendorClass):
# PLN ONLY # PLN ONLY
if not self.v_produk_kd or not self.bill_no: if not self.v_produk_kd or not self.bill_no:
return return
b
if self.v_produk_kd =='PLN' and self.v_produk_kd != 'PLNPASCA': if self.v_produk_kd =='PLN' and self.v_produk_kd != 'PLNPASCA':
params = dict( params = dict(
data=dict( data=dict(
...@@ -91,7 +91,6 @@ class Vendor(VendorClass): ...@@ -91,7 +91,6 @@ class Vendor(VendorClass):
def payment(self): def payment(self):
if not self.v_produk_kd or not self.bill_no: if not self.v_produk_kd or not self.bill_no:
return return
params = dict( params = dict(
data=dict( data=dict(
denom=self.v_produk_kd, denom=self.v_produk_kd,
...@@ -104,7 +103,7 @@ class Vendor(VendorClass): ...@@ -104,7 +103,7 @@ class Vendor(VendorClass):
content = None content = None
if resp and resp.text: if resp and resp.text:
content = json.loads(resp.text) content = json.loads(resp.text)
if resp.ok: if resp.ok:
#todo mapping content #todo mapping content
""" """
...@@ -139,6 +138,7 @@ class Vendor(VendorClass): ...@@ -139,6 +138,7 @@ class Vendor(VendorClass):
""" """
result = content result = content
else: else:
content = json.loads(resp.text)
result = dict(code=resp.status_code, result = dict(code=resp.status_code,
message=resp.text) message=resp.text)
self.response = content self.response = content
......
...@@ -345,7 +345,7 @@ class VendorClass(object): ...@@ -345,7 +345,7 @@ class VendorClass(object):
row.inquiry = dict(request=self.request, row.inquiry = dict(request=self.request,
response=self.response) response=self.response)
elif typ == 'payment': elif typ == 'payment':
row.inquiry = dict(request=self.request, row.payment = dict(request=self.request,
response=self.response) response=self.response)
elif typ == 'advice': elif typ == 'advice':
row.advice = dict(request=self.request, row.advice = dict(request=self.request,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!