Commit cc8c6a5d by Kunto Bregananta Adi

init

1 parent ada1fdd9
Showing 113 changed files with 64 additions and 66 deletions
...@@ -29,11 +29,11 @@ if sys.argv[1:] and sys.argv[1] == 'develop-use-pip': ...@@ -29,11 +29,11 @@ if sys.argv[1:] and sys.argv[1] == 'develop-use-pip':
sys.exit() sys.exit()
setup( setup(
name='agratek.api.merchant', name='agratek.backoffice',
version='0.1.0', version='0.1.0',
url='', url='',
license='', license='',
description='Api Merhant PasarQu', description='AgraTek Backoffice for merchants',
long_description=README + '\n\n' + CHANGES, long_description=README + '\n\n' + CHANGES,
author='', author='',
author_email='', author_email='',
...@@ -56,9 +56,9 @@ setup( ...@@ -56,9 +56,9 @@ setup(
'dev': dev_requires, 'dev': dev_requires,
}, },
test_suite="agratek.api.merchant.test", test_suite="agratek.backoffice.test",
entry_points="""\ entry_points="""\
[console_scripts] [console_scripts]
initialize_agratek_api_merchant_db = agratek.api.merchant.scripts.initializedb:main initialize_agratek_api_merchant_db = agratek.api.backoffice.scripts.initializedb:main
""", """,
) )
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
\ No newline at end of file \ No newline at end of file
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,7 @@ from opensipkd.pasar.models.views import deferred_vendor, deferred_customer, def ...@@ -3,7 +3,7 @@ from opensipkd.pasar.models.views import deferred_vendor, deferred_customer, def
from pyramid.view import view_config from pyramid.view import view_config
@view_config(route_name='api-merchant-home', @view_config(route_name='api-backoffice-home',
permission="view", permission="view",
renderer='templates/home.pt') renderer='templates/home.pt')
def view_home(request): def view_home(request):
......
...@@ -34,7 +34,7 @@ def build_request(typ, vendor_produk, partner_log=None, **kwargs): ...@@ -34,7 +34,7 @@ def build_request(typ, vendor_produk, partner_log=None, **kwargs):
# bill_no = values['destination'] # bill_no = values['destination']
# customer_id = 'customer_id' in values and values['customer_id'] or None # customer_id = 'customer_id' in values and values['customer_id'] or None
# cust_trx_id = 'cust_trx_id' in values and values['cust_trx_id'] or None # cust_trx_id = 'cust_trx_id' in values and values['cust_trx_id'] or None
pckgs = 'agratek.api.merchant.views' pckgs = 'agratek.api.backoffice.views'
moduls = vendor_produk.modules.split('.') moduls = vendor_produk.modules.split('.')
if len(moduls) > 1: if len(moduls) > 1:
pckg = ".".join(moduls[:-1]) pckg = ".".join(moduls[:-1])
...@@ -86,7 +86,7 @@ def get_vendor_produk(produk_kd, vendor_kd=None, harga=None): ...@@ -86,7 +86,7 @@ def get_vendor_produk(produk_kd, vendor_kd=None, harga=None):
return row return row
@jsonrpc_method(method='inquiry', endpoint='api-merchant') @jsonrpc_method(method='inquiry', endpoint='api-backoffice')
def inquiry(request, data, **kwargs): def inquiry(request, data, **kwargs):
""" """
Digunakan untuk mendapatkan data tagihan Digunakan untuk mendapatkan data tagihan
...@@ -96,7 +96,7 @@ def inquiry(request, data, **kwargs): ...@@ -96,7 +96,7 @@ def inquiry(request, data, **kwargs):
denom: string, denom: string,
id_pel:string id_pel:string
} }
:param token: (jika merchant wajib menggunakan token) :param token: (jika backoffice wajib menggunakan token)
user_token user_token
:return: :return:
{ {
...@@ -162,7 +162,7 @@ def build_purchase(vendor_produk, partner_log=None): ...@@ -162,7 +162,7 @@ def build_purchase(vendor_produk, partner_log=None):
return build_request('payment', vendor_produk, partner_log) return build_request('payment', vendor_produk, partner_log)
@jsonrpc_method(method='purchase', endpoint='api-merchant') @jsonrpc_method(method='purchase', endpoint='api-backoffice')
def purchase(request, data, **kwargs): def purchase(request, data, **kwargs):
""" """
Digunakan untuk mendapatkan daftar produk Digunakan untuk mendapatkan daftar produk
...@@ -270,7 +270,7 @@ def payment_advice(dat): ...@@ -270,7 +270,7 @@ def payment_advice(dat):
vendor_nm = vend_produk.modules vendor_nm = vend_produk.modules
modul = '.advice' modul = '.advice'
pckgs = 'agratek.api.merchant.views.{}'.format(vendor_nm) pckgs = 'agratek.api.backoffice.views.{}'.format(vendor_nm)
moduls = import_module(modul, pckgs) moduls = import_module(modul, pckgs)
typ = 'proses' typ = 'proses'
cls = hasattr(moduls, typ) and getattr(moduls, typ) or None cls = hasattr(moduls, typ) and getattr(moduls, typ) or None
...@@ -334,7 +334,7 @@ def purchase_advice(customer, dat): ...@@ -334,7 +334,7 @@ def purchase_advice(customer, dat):
return dat return dat
@jsonrpc_method(method='advice', endpoint='api-merchant') @jsonrpc_method(method='advice', endpoint='api-backoffice')
def advice(request, data): def advice(request, data):
""" """
Digunakan untuk mendapatkan daftar produk Digunakan untuk mendapatkan daftar produk
...@@ -413,7 +413,7 @@ def cancel_tx(dat): ...@@ -413,7 +413,7 @@ def cancel_tx(dat):
vendor_nm = vend_produk.modules vendor_nm = vend_produk.modules
modul = '.cancel_tx' modul = '.cancel_tx'
pckgs = 'agratek.api.merchant.views.{}'.format(vendor_nm) pckgs = 'agratek.api.backoffice.views.{}'.format(vendor_nm)
moduls = import_module(modul, pckgs) moduls = import_module(modul, pckgs)
typ = 'proses' typ = 'proses'
cls = hasattr(moduls, typ) and getattr(moduls, typ) or None cls = hasattr(moduls, typ) and getattr(moduls, typ) or None
...@@ -424,7 +424,7 @@ def cancel_tx(dat): ...@@ -424,7 +424,7 @@ def cancel_tx(dat):
return dict() return dict()
@jsonrpc_method(method='cancel', endpoint='api-merchant') @jsonrpc_method(method='cancel', endpoint='api-backoffice')
def cancel_rpc(request, data): def cancel_rpc(request, data):
user = auth_from_rpc(request) user = auth_from_rpc(request)
i = 0 i = 0
......
...@@ -25,7 +25,7 @@ def build_request(typ, vendor_produk, partner_log=None, **kwargs): ...@@ -25,7 +25,7 @@ def build_request(typ, vendor_produk, partner_log=None, **kwargs):
# bill_no = values['destination'] # bill_no = values['destination']
# customer_id = 'customer_id' in values and values['customer_id'] or None # customer_id = 'customer_id' in values and values['customer_id'] or None
# cust_trx_id = 'cust_trx_id' in values and values['cust_trx_id'] or None # cust_trx_id = 'cust_trx_id' in values and values['cust_trx_id'] or None
pckgs = 'agratek.api.merchant.views' pckgs = 'agratek.api.backoffice.views'
moduls = vendor_produk.modules.split('.') moduls = vendor_produk.modules.split('.')
if len(moduls) > 1: if len(moduls) > 1:
pckg = ".".join(moduls[:-1]) pckg = ".".join(moduls[:-1])
...@@ -135,7 +135,7 @@ def set_register_values(dat, customer): ...@@ -135,7 +135,7 @@ def set_register_values(dat, customer):
return values return values
@jsonrpc_method(method='register', endpoint='api-merchant') @jsonrpc_method(method='register', endpoint='api-backoffice')
def register(request, data, **kwargs): def register(request, data, **kwargs):
user = auth_from_rpc(request) user = auth_from_rpc(request)
i = 0 i = 0
...@@ -226,7 +226,7 @@ def form_result(request, values): ...@@ -226,7 +226,7 @@ def form_result(request, values):
class ViewData(BaseView): class ViewData(BaseView):
@view_config(route_name='api-merchant-payment', @view_config(route_name='api-backoffice-payment',
renderer='templates/form-clean.pt') renderer='templates/form-clean.pt')
def view_api_merchant_payment(self): def view_api_merchant_payment(self):
request = self.req request = self.req
...@@ -244,7 +244,7 @@ class ViewData(BaseView): ...@@ -244,7 +244,7 @@ class ViewData(BaseView):
vendor_produk = PartnerProduk.get_produk(invoice_det.vendor_id, vendor_produk = PartnerProduk.get_produk(invoice_det.vendor_id,
invoice_det.produk_id).first() invoice_det.produk_id).first()
pckgs = 'agratek.api.merchant.views' pckgs = 'agratek.api.backoffice.views'
moduls = vendor_produk.modules.split('.') moduls = vendor_produk.modules.split('.')
if len(moduls) > 1: if len(moduls) > 1:
pckg = ".".join(moduls[:-1]) pckg = ".".join(moduls[:-1])
...@@ -286,7 +286,7 @@ def api_vendor_callback(request): ...@@ -286,7 +286,7 @@ def api_vendor_callback(request):
# print(data) # print(data)
vendor_nm = request.matchdict['name'] vendor_nm = request.matchdict['name']
modul = '.callback' modul = '.callback'
pckgs = 'agratek.api.merchant.views.{}'.format(vendor_nm) pckgs = 'agratek.api.backoffice.views.{}'.format(vendor_nm)
moduls = import_module(modul, pckgs) moduls = import_module(modul, pckgs)
typ = 'proses' typ = 'proses'
log.info("Pckgs: {} Modul:{} typ {}".format(pckgs, modul, typ)) log.info("Pckgs: {} Modul:{} typ {}".format(pckgs, modul, typ))
...@@ -297,5 +297,5 @@ def api_vendor_callback(request): ...@@ -297,5 +297,5 @@ def api_vendor_callback(request):
if result: if result:
return dict(form=result["form"]) return dict(form=result["form"])
qs = get_qs(data) qs = get_qs(data)
return HTTPFound(location=request.route_url("api-merchant-register-callback", _query=qs)) return HTTPFound(location=request.route_url("api-backoffice-register-callback", _query=qs))
# return dict(form="<h1>ERROR</h1>") # return dict(form="<h1>ERROR</h1>")
...@@ -209,7 +209,7 @@ class ViewData(BaseView): ...@@ -209,7 +209,7 @@ class ViewData(BaseView):
}); });
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -127,7 +127,7 @@ class ViewData(BaseView): ...@@ -127,7 +127,7 @@ class ViewData(BaseView):
'route': "/api/purchase", 'route': "/api/purchase",
'scripts': """ 'scripts': """
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -105,7 +105,7 @@ class ViewData(BaseView): ...@@ -105,7 +105,7 @@ class ViewData(BaseView):
}); });
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -25,7 +25,7 @@ iMid Y AN 10 Merchant Id ...@@ -25,7 +25,7 @@ iMid Y AN 10 Merchant Id
payMethod Y AN 2 Payment Method payMethod Y AN 2 Payment Method
currency Y AN 3 currency currency Y AN 3 currency
amt Y N 12 Payment Amount amt Y N 12 Payment Amount
referenceNo Y ANS 40 Merchant Order No (Key from merchant) referenceNo Y ANS 40 Merchant Order No (Key from backoffice)
goodsNm Y AN 100 Goods Name goodsNm Y AN 100 Goods Name
billingNm Y A 30 Buyer name billingNm Y A 30 Buyer name
billingPhone Y N 40 Buyer Phone Number billingPhone Y N 40 Buyer Phone Number
...@@ -81,7 +81,7 @@ payValidTm Y N 6 135959 expiry time (HH24MISS) ...@@ -81,7 +81,7 @@ payValidTm Y N 6 135959 expiry time (HH24MISS)
# merchant_token Y AN 255 merchantToken # merchant_token Y AN 255 merchantToken
pay_method Y AN 2 Payment Method pay_method Y AN 2 Payment Method
amount Y N 12 Payment Amount amount Y N 12 Payment Amount
invoice_no Y ANS 40 Merchant Order No (Key from merchant) invoice_no Y ANS 40 Merchant Order No (Key from backoffice)
goods_nm Y AN 100 Goods Name goods_nm Y AN 100 Goods Name
billing_nm Y A 30 Buyer name billing_nm Y A 30 Buyer name
billing_phone Y N 40 Buyer Phone Number billing_phone Y N 40 Buyer Phone Number
...@@ -421,7 +421,7 @@ class CCardPayment(colander.Schema): ...@@ -421,7 +421,7 @@ class CCardPayment(colander.Schema):
callback_url = colander.SchemaNode( callback_url = colander.SchemaNode(
colander.String(), colander.String(),
# default="{}/api/merchant/register/callback".format("https://server"), # default="{}/api/backoffice/register/callback".format("https://server"),
widget=widget.TextInputWidget(max_len=255) widget=widget.TextInputWidget(max_len=255)
) )
...@@ -487,7 +487,7 @@ class CPPayment(colander.Schema): ...@@ -487,7 +487,7 @@ class CPPayment(colander.Schema):
) )
callback_url = colander.SchemaNode( callback_url = colander.SchemaNode(
colander.String(), colander.String(),
default="{}/api/merchant/register/callback".format("https://server"), default="{}/api/backoffice/register/callback".format("https://server"),
widget=widget.TextInputWidget(max_len=255) widget=widget.TextInputWidget(max_len=255)
) )
...@@ -500,7 +500,7 @@ class WLPayment(colander.Schema): ...@@ -500,7 +500,7 @@ class WLPayment(colander.Schema):
) )
callback_url = colander.SchemaNode( callback_url = colander.SchemaNode(
colander.String(), colander.String(),
default="{}/api/merchant/register/callback".format("https://server"), default="{}/api/backoffice/register/callback".format("https://server"),
widget=widget.TextInputWidget(max_len=255) widget=widget.TextInputWidget(max_len=255)
) )
...@@ -536,7 +536,7 @@ class CVSResult(colander.Schema): ...@@ -536,7 +536,7 @@ class CVSResult(colander.Schema):
class PLPayment(colander.Schema): class PLPayment(colander.Schema):
callback_url = colander.SchemaNode( callback_url = colander.SchemaNode(
colander.String(), colander.String(),
default="{}/api/merchant/register/callback".format("https://server"), default="{}/api/backoffice/register/callback".format("https://server"),
widget=widget.TextInputWidget(max_len=255) widget=widget.TextInputWidget(max_len=255)
) )
...@@ -557,7 +557,7 @@ def get_form(request, class_form, buttons=None, row=None): ...@@ -557,7 +557,7 @@ def get_form(request, class_form, buttons=None, row=None):
def route_register(request): def route_register(request):
return HTTPFound(location=request.route_url('api-merchant-register')) return HTTPFound(location=request.route_url('api-backoffice-register'))
btn_proses = Button('proses', title='Proses', css_class="btn-warning") btn_proses = Button('proses', title='Proses', css_class="btn-warning")
...@@ -669,7 +669,7 @@ def proses(request): ...@@ -669,7 +669,7 @@ def proses(request):
("callback_url", values["callback_url"]), ("callback_url", values["callback_url"]),
) )
url = request.route_url("api-merchant-payment", _query=_query) url = request.route_url("api-backoffice-payment", _query=_query)
return HTTPFound(url) return HTTPFound(url)
elif denom[:2] in ["WL","PL"]: elif denom[:2] in ["WL","PL"]:
result = register(request, data=data) result = register(request, data=data)
...@@ -683,8 +683,8 @@ def proses(request): ...@@ -683,8 +683,8 @@ def proses(request):
("invoice_no",dat["invoice_no"]), ("invoice_no",dat["invoice_no"]),
("callback_url",values["callback_url"]), ("callback_url",values["callback_url"]),
) )
url = request.route_url("api-merchant-payment", _query=_query) url = request.route_url("api-backoffice-payment", _query=_query)
# url = request.route_url("api-merchant-payment", _query=_query) # url = request.route_url("api-backoffice-payment", _query=_query)
return HTTPFound(url) return HTTPFound(url)
elif denom[:2] == "CP": elif denom[:2] == "CP":
data.update(dict(va=dict( data.update(dict(va=dict(
...@@ -706,8 +706,8 @@ def proses(request): ...@@ -706,8 +706,8 @@ def proses(request):
("cp_token",values["cp_token"]), ("cp_token",values["cp_token"]),
("callback_url",values["callback_url"]), ("callback_url",values["callback_url"]),
) )
url = request.route_url("api-merchant-payment", _query=_query) url = request.route_url("api-backoffice-payment", _query=_query)
# url = request.route_url("api-merchant-payment", _query=_query) # url = request.route_url("api-backoffice-payment", _query=_query)
return HTTPFound(url) return HTTPFound(url)
elif denom[:2] == "VA": elif denom[:2] == "VA":
...@@ -752,8 +752,8 @@ def proses(request): ...@@ -752,8 +752,8 @@ def proses(request):
class ViewHome(BaseView): class ViewHome(BaseView):
@view_config(route_name='api-merchant-register', @view_config(route_name='api-backoffice-register',
permission="api-merchant-register", permission="api-backoffice-register",
renderer='templates/form.pt') renderer='templates/form.pt')
def form_merchant_register(self): def form_merchant_register(self):
request = self.req request = self.req
...@@ -775,7 +775,7 @@ class ViewHome(BaseView): ...@@ -775,7 +775,7 @@ class ViewHome(BaseView):
log.info("Data Requested server: {}".format(data)) log.info("Data Requested server: {}".format(data))
session['payment'] = data session['payment'] = data
form = payment(request, data, form) form = payment(request, data, form)
values = dict(callback_url="{}/api/merchant/register/callback".format(request._host)) values = dict(callback_url="{}/api/backoffice/register/callback".format(request._host))
form.render(values) form.render(values)
return dict(form=form, params=dict(scripts="")) return dict(form=form, params=dict(scripts=""))
...@@ -798,8 +798,8 @@ class ViewHome(BaseView): ...@@ -798,8 +798,8 @@ class ViewHome(BaseView):
form.render(values) form.render(values)
return dict(form=form, params=dict(scripts="")) return dict(form=form, params=dict(scripts=""))
@view_config(route_name='api-merchant-register-callback', @view_config(route_name='api-backoffice-register-callback',
# permission="api-merchant-register-callback", # permission="api-backoffice-register-callback",
renderer='templates/form.pt') renderer='templates/form.pt')
def form_merchant_register_callback(self): def form_merchant_register_callback(self):
request = self.req request = self.req
......
...@@ -34,7 +34,7 @@ def update_harga(p, k, v): ...@@ -34,7 +34,7 @@ def update_harga(p, k, v):
def purchase_notify(order): def purchase_notify(order):
print('purchase_notify >>') print('purchase_notify >>')
# Callback to merchant # Callback to backoffice
if hasattr(order, "customer_id"): if hasattr(order, "customer_id"):
customer = order.customer customer = order.customer
invoice = order invoice = order
...@@ -95,7 +95,7 @@ def payment_notify(order): ...@@ -95,7 +95,7 @@ def payment_notify(order):
key = order.cust_inv_no + users.user_name + users.api_key + typ key = order.cust_inv_no + users.user_name + users.api_key + typ
signature = sha256(key) signature = sha256(key)
data = order.notify["result"] data = order.notify["result"]
# tx_id merchant harus dikirim # tx_id backoffice harus dikirim
tx_id = order.tx_id tx_id = order.tx_id
if not tx_id: if not tx_id:
pay_request = 'request' in order.payment \ pay_request = 'request' in order.payment \
...@@ -136,7 +136,7 @@ def api_vendor_notify(request): ...@@ -136,7 +136,7 @@ def api_vendor_notify(request):
return return
modul = '.notify' modul = '.notify'
pckgs = 'agratek.api.merchant.views.{}'.format(vendor_nm) pckgs = 'agratek.api.backoffice.views.{}'.format(vendor_nm)
moduls = import_module(modul, pckgs) moduls = import_module(modul, pckgs)
typ = 'proses' typ = 'proses'
cls = hasattr(moduls, typ) and getattr(moduls, typ) or None cls = hasattr(moduls, typ) and getattr(moduls, typ) or None
......
...@@ -272,7 +272,7 @@ class Vendor(VendorClass): # VendorClass ...@@ -272,7 +272,7 @@ class Vendor(VendorClass): # VendorClass
submit_form(); submit_form();
}); });
""" """
# /api/merchant/payment # /api/backoffice/payment
form = """ form = """
<form action="{url}" method="post" name="payment"> <form action="{url}" method="post" name="payment">
<input type="hidden" name="timeStamp" value="{time_stamp}"> <input type="hidden" name="timeStamp" value="{time_stamp}">
...@@ -320,7 +320,7 @@ class Vendor(VendorClass): # VendorClass ...@@ -320,7 +320,7 @@ class Vendor(VendorClass): # VendorClass
submit_form(); submit_form();
}); });
""" """
# /api/merchant/payment # /api/backoffice/payment
form = """ form = """
<form action="{url}" method="post" name="payment"> <form action="{url}" method="post" name="payment">
<input type="hidden" name="timeStamp" value="{time_stamp}"> <input type="hidden" name="timeStamp" value="{time_stamp}">
...@@ -363,7 +363,7 @@ class Vendor(VendorClass): # VendorClass ...@@ -363,7 +363,7 @@ class Vendor(VendorClass): # VendorClass
submit_form(); submit_form();
}); });
""" """
# /api/merchant/payment # /api/backoffice/payment
form = """ form = """
<form action="{url}" method="post" name="payment"> <form action="{url}" method="post" name="payment">
<input type="hidden" name="timeStamp" value="{time_stamp}"> <input type="hidden" name="timeStamp" value="{time_stamp}">
...@@ -406,7 +406,7 @@ class Vendor(VendorClass): # VendorClass ...@@ -406,7 +406,7 @@ class Vendor(VendorClass): # VendorClass
submit_form(); submit_form();
}); });
""" """
# /api/merchant/payment # /api/backoffice/payment
f = "" f = ""
result = self.result result = self.result
...@@ -531,7 +531,7 @@ def get_result(response, pay_method): ...@@ -531,7 +531,7 @@ def get_result(response, pay_method):
# cancel_amt="cancelAmt" in response and int(response["cancelAmt"]) or 0, # cancel_amt="cancelAmt" in response and int(response["cancelAmt"]) or 0,
# deposit_date="depositDt" in response and response["depositDt"] or "", # deposit_date="depositDt" in response and response["depositDt"] or "",
# deposit_time="depositTm" in response and response["depositTm"] or "", # deposit_time="depositTm" in response and response["depositTm"] or "",
# tx_id= "", # <= diisi tx_id merchant saat request register # tx_id= "", # <= diisi tx_id backoffice saat request register
) )
if code!=0: if code!=0:
......
...@@ -127,7 +127,7 @@ class Vendor(object): #VendorClass ...@@ -127,7 +127,7 @@ class Vendor(object): #VendorClass
# Nicepay.set('description', 'Description') # Nicepay.set('description', 'Description')
# Nicepay.set('reqDt', '20160301') # Format (YYYYMMDD) # Nicepay.set('reqDt', '20160301') # Format (YYYYMMDD)
# Nicepay.set('reqTm', '135959') # Format (HHiiss) # Nicepay.set('reqTm', '135959') # Format (HHiiss)
# Nicepay.set('reqDomain', 'merchant.com') # Nicepay.set('reqDomain', 'backoffice.com')
# Nicepay.set('reqServerIP', '127.0.0.1') # Nicepay.set('reqServerIP', '127.0.0.1')
# Nicepay.set('reqClientVer', '1.0') # Nicepay.set('reqClientVer', '1.0')
# Nicepay.set('userSessionID', 'userSessionID') # Nicepay.set('userSessionID', 'userSessionID')
......
...@@ -120,9 +120,9 @@ class view_pay(BaseView): ...@@ -120,9 +120,9 @@ class view_pay(BaseView):
row_pay = DBSession.query(PartnerPay).filter(PartnerPay.token_pay_req == url_dict['pay_token']).first() row_pay = DBSession.query(PartnerPay).filter(PartnerPay.token_pay_req == url_dict['pay_token']).first()
#target to send the register response #target to send the register response
merchant_url = row_pay.response_url merchant_url = row_pay.response_url
#getting the merchant data #getting the backoffice data
customer = Partner.query().filter(Partner.id == row_pay.customer_id).first() customer = Partner.query().filter(Partner.id == row_pay.customer_id).first()
#getting the merchant authentication data #getting the backoffice authentication data
registered_user = customer.users registered_user = customer.users
produk_kd = '' produk_kd = ''
...@@ -302,7 +302,7 @@ class view_pay(BaseView): ...@@ -302,7 +302,7 @@ class view_pay(BaseView):
# return HTTPFound(route_to) # return HTTPFound(route_to)
elif 'batal' in post_data: elif 'batal' in post_data:
return HTTPFound(location=request.route_url('api-merchant-home')) return HTTPFound(location=request.route_url('api-backoffice-home'))
formSchema = FormSchema() formSchema = FormSchema()
...@@ -382,7 +382,7 @@ def get_api_url(): ...@@ -382,7 +382,7 @@ def get_api_url():
settings = get_settings() settings = get_settings()
hostnya = settings['_host'] hostnya = settings['_host']
# hostnya = 'https://devel.agratek.id' # hostnya = 'https://devel.agratek.id'
url = hostnya + "/api/merchant" url = hostnya + "/api/backoffice"
return url return url
...@@ -523,7 +523,7 @@ def build_request_json(denom, row, produks): ...@@ -523,7 +523,7 @@ def build_request_json(denom, row, produks):
# "invoice_no": "300bssx5t", # "invoice_no": "300bssx5t",
# "server": { # "server": {
# "ip": "127.0.0.1", # "ip": "127.0.0.1",
# "domain": "merchant.com" # "domain": "backoffice.com"
# }, # },
# "vat": 0, # "vat": 0,
# "cart": { # "cart": {
......
...@@ -224,7 +224,7 @@ class view_pay(BaseView): ...@@ -224,7 +224,7 @@ class view_pay(BaseView):
settings = get_settings() settings = get_settings()
hostnya = settings['_host'] hostnya = settings['_host']
url = hostnya + "/api/merchant" url = hostnya + "/api/backoffice"
body = { body = {
"jsonrpc": "2.0", "jsonrpc": "2.0",
...@@ -282,7 +282,7 @@ class view_pay(BaseView): ...@@ -282,7 +282,7 @@ class view_pay(BaseView):
"item": produks "item": produks
}, },
"server": { "server": {
"domain": "merchant.com", "domain": "backoffice.com",
"ip": "127.0.0.1" "ip": "127.0.0.1"
} }
} }
...@@ -430,7 +430,7 @@ class view_pay(BaseView): ...@@ -430,7 +430,7 @@ class view_pay(BaseView):
server_def_data = {} server_def_data = {}
server_def_data['domain_server'] = 'merchant.com' server_def_data['domain_server'] = 'backoffice.com'
server_def_data['ip_server'] = '127.0.0.1' server_def_data['ip_server'] = '127.0.0.1'
formServer.render(server_def_data); formServer.render(server_def_data);
......
...@@ -133,7 +133,7 @@ def get_input_error(data): ...@@ -133,7 +133,7 @@ def get_input_error(data):
@jsonrpc_method(method='pay_request', endpoint='api-merchant') @jsonrpc_method(method='pay_request', endpoint='api-backoffice')
def pay_request(request, data, **kwargs): def pay_request(request, data, **kwargs):
user = auth_from_rpc(request) user = auth_from_rpc(request)
# user = DBSession.query(User).filter(User.id == 1).first() # user = DBSession.query(User).filter(User.id == 1).first()
......
...@@ -176,7 +176,7 @@ class ViewData(BaseView): ...@@ -176,7 +176,7 @@ class ViewData(BaseView):
'route': "/api/payment", 'route': "/api/payment",
'scripts': """ 'scripts': """
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -185,7 +185,7 @@ class ViewData(BaseView): ...@@ -185,7 +185,7 @@ class ViewData(BaseView):
}); });
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -186,7 +186,7 @@ class ViewData(BaseView): ...@@ -186,7 +186,7 @@ class ViewData(BaseView):
}); });
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -133,7 +133,7 @@ class ViewData(BaseView): ...@@ -133,7 +133,7 @@ class ViewData(BaseView):
'route': "/api/purchase", 'route': "/api/purchase",
'scripts': """ 'scripts': """
$("#btn_close").click(function() { $("#btn_close").click(function() {
window.location = '/api/merchant'; window.location = '/api/backoffice';
return false; return false;
}); });
"""} """}
......
...@@ -67,7 +67,7 @@ class VendorClass(object): ...@@ -67,7 +67,7 @@ class VendorClass(object):
func = self.vendor_produk.produk.kategori.module func = self.vendor_produk.produk.kategori.module
if not func: if not func:
func = "Result" func = "Result"
pckgs = 'agratek.api.merchant.views.vendor' pckgs = 'agratek.api.backoffice.views.vendor'
log.info("Module: %s Pckgs: %s" % (func, pckgs)) log.info("Module: %s Pckgs: %s" % (func, pckgs))
......
...@@ -329,7 +329,7 @@ def get_row(id): ...@@ -329,7 +329,7 @@ def get_row(id):
# trx_id = int(values['trx_id']) # trx_id = int(values['trx_id'])
# row = PartnerLog.query().filter_by(id=trx_id).first() # row = PartnerLog.query().filter_by(id=trx_id).first()
# #
# modules = import_module('.' + vendor_product.modules, 'agratek.api.merchant.views') # modules = import_module('.' + vendor_product.modules, 'agratek.api.backoffice.views')
# #
# cls_module = modules.Vendor(vendor_product, bill_no, customer_id, # cls_module = modules.Vendor(vendor_product, bill_no, customer_id,
# cust_trx_id, row) # cust_trx_id, row)
......
...@@ -5,7 +5,7 @@ mynt dev (company) : kunto@agratek.id (username) ...@@ -5,7 +5,7 @@ mynt dev (company) : kunto@agratek.id (username)
: 009 (referal code) : 009 (referal code)
mynt dev (merchant) : kunto@agratek.id (username) mynt dev (backoffice) : kunto@agratek.id (username)
: Passw0rd! (password) : Passw0rd! (password)
: 811568055 (no hp) : 811568055 (no hp)
: 009 (referal code) : 009 (referal code)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!