本文整理汇总了Python中market.contracts.Contract.process_refund方法的典型用法代码示例。如果您正苦于以下问题:Python Contract.process_refund方法的具体用法?Python Contract.process_refund怎么用?Python Contract.process_refund使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类market.contracts.Contract
的用法示例。
在下文中一共展示了Contract.process_refund方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rpc_refund
# 需要导入模块: from market.contracts import Contract [as 别名]
# 或者: from market.contracts.Contract import process_refund [as 别名]
def rpc_refund(self, sender, pubkey, encrypted):
try:
box = Box(self.signing_key.to_curve25519_private_key(), PublicKey(pubkey))
refund = box.decrypt(encrypted)
refund_json = json.loads(refund, object_pairs_hook=OrderedDict)
c = Contract(self.db, hash_value=unhexlify(refund_json["refund"]["order_id"]),
testnet=self.multiplexer.testnet)
c.process_refund(refund_json, self.multiplexer.blockchain, self.get_notification_listener())
self.router.addContact(sender)
self.log.info("order %s refunded by vendor" % refund_json["refund"]["order_id"])
return ["True"]
except Exception, e:
self.log.error("unable to parse refund message from %s" % sender)
return [e.message]