Commit 63d68582 by Solo Group

add notify test

1 parent a8ab70a7
......@@ -36,6 +36,7 @@ def purchase_notify(order):
# Callback to merchant
if hasattr(order, "customer_id"):
customer = order.customer
invoice = order
else:
invoice = order.invoice
customer = invoice.customer
......@@ -48,6 +49,7 @@ def purchase_notify(order):
or "PENDING"
key = invoice.cust_inv_no + users.user_name + users.api_key + status
signature = sha256(key)
data = []
produk = []
dat = dict(
......@@ -66,9 +68,8 @@ def purchase_notify(order):
))
dat.update(produk=produk)
data.append(dat)
log.info("Notify Save: %s %s" % (data))
log.info("Notify Save: %s" % (data))
order.notify["result"] = data
flush_row(order)
js = get_jsonrpc(method="notify", params=dict(data=data))
log.info("Notify: %s %s" % (url, js))
......@@ -101,7 +102,8 @@ def payment_notify(order):
type=typ,
tx_id=tx_id
))
js = get_jsonrpc(method="notify", params=dict(data=data))
params = dict(data=data)
js = get_jsonrpc(method="notify", params=params)
log.info("Notify: %s %s" % (url, js))
try:
......
......@@ -62,7 +62,7 @@ def proses(data):
# todo: add to customer notify table
# todo: create cron for notify
# proses jika status 1 notify ada isinya tapi belum ada field result
# todo: create cron torecurring order to other vendor
# todo: create cron to recurring order to other vendor
# jika status = -2 proses vendor yang lain
purchase_notify(order)
return order
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!