def post(self): """ 给商户发通知 :return: """ form, error = OrderStateNotifyFrom().request_validate() if error: return error.as_response() order_id = form.order_id.data order_type = form.order_type.data if order_type == PayTypeEnum.WITHDRAW: order = WithdrawTransactionCtl.get_order_by_order_id(order_id) rst = WithdrawTransactionCtl.do_notify( order=order, op_account=g.user.account, comment="后台人工状态通知", ) else: order = DepositTransactionCtl.get_order_by_order_id(order_id) rst = DepositTransactionCtl.do_notify( order=order, op_account=g.user.account, comment="后台人工状态通知", ) return ResponseSuccess(message=rst['msg'])
def get(self): """ 手动通知商户 :return: """ if not request.args: return ResponseSuccess(message="参数规则:?tx_id=xx").as_response() try: tx_id = request.args['tx_id'] except: return ResponseSuccess(message="请输入 tx_id=,系统交易ID").as_response() order = WithdrawTransactionCtl.get_order(tx_id) rst = WithdrawTransactionCtl.do_notify( order=order, op_account='somebody', comment="后台人工状态通知", ) return ResponseSuccess(message=rst['msg']).as_response()
def post(self): """ 给商户发通知 :return: """ form, error = OrderStateNotifyFrom().request_validate() if error: return error.as_response() order_id = str(form.order_id.data) if form.type.data == PayTypeEnum.WITHDRAW: order = WithdrawTransactionCtl.get_order(order_id) rst = WithdrawTransactionCtl.do_notify(order=order, op_account=g.user.account, comment="商户后台手动通知") elif form.type.data == PayTypeEnum.DEPOSIT: order = DepositTransactionCtl.get_order(order_id) rst = DepositTransactionCtl.do_notify( order=order, op_account=g.user.account, comment="商户后台手动通知", ) return ResponseSuccess(message=rst['msg'])