Commit 85ff40f5 by Tatang

open remark

1 parent a7c7d7c4
...@@ -76,19 +76,25 @@ def purchase_notify(order): ...@@ -76,19 +76,25 @@ def purchase_notify(order):
def payment_notify(order): def payment_notify(order):
customer = order.customer customer = order.customer
# if customer and customer.website: # if customer: # for test
if customer: # for test if customer and customer.website:
url = customer.website url = customer.website
users = customer.users users = customer.users
typ = "PAYMENT" typ = "PAYMENT"
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 = order.tx_id
if not tx_id:
pay_request = 'request' in order.payment and order.payment['request'] or {}
tx_id = 'tx_id' in pay_request and pay_request['tx_id'] or ""
data.update(dict( data.update(dict(
invoice_no=order.cust_inv_no, invoice_no=order.cust_inv_no,
signature=signature, signature=signature,
type=typ, type=typ,
tx_id=order.tx_id tx_id=tx_id
)) ))
# data.update(order.notify["result"]) # data.update(order.notify["result"])
# print('>>>', json.dumps(data, indent=4, sort_keys=True)) # print('>>>', json.dumps(data, indent=4, sort_keys=True))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!