Commit 0f487f14 by Solo Group

add notify test

1 parent 63d68582
......@@ -116,14 +116,14 @@ def payment_notify(order):
@view_config(route_name='api-vendor-notify', renderer='json')
def api_vendor_notify(request):
vendor_nm = request.matchdict['name']
log.info("NOTIFY BEGIN {}".format(vendor_nm))
try:
data = json.loads(request.text)
except:
data = request.POST and dict(request.POST.items()) or dict(request.GET.items())
if vendor_nm=="test":
log.info("TEST NOTIFY {}".format(data))
log.info("NOTIFY TEST {}".format(data))
return
modul = '.notify'
......@@ -131,8 +131,10 @@ def api_vendor_notify(request):
moduls = import_module(modul, pckgs)
typ = 'proses'
cls = hasattr(moduls, typ) and getattr(moduls, typ) or None
log.info("NOTIFY MODULES {} {} {}".format(pckgs, moduls, typ))
if cls:
order = cls(data)
log.info("NOTIFY END")
@view_config(route_name='api-vendor-test', renderer="string")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!