def get(self, order_no): order = TeamOrder.get_or_404(order_no=order_no) self.write({ "order_no": order.order_no, "team_id": order.team_id, "state": TeamOrder.OrderState(order.state).name })
def post(self): action = self.get_argument("action") if action == "refund": order_id = self.get_argument("order_id") order = TeamOrder.get_or_404(id=order_id) if order.is_refund_failed(): order.refund() self.write_success()
def post(self, order_no): order = TeamOrder.get_or_404(order_no=order_no, user=self.current_user) self.check_order_state(order) notify_url = "" paystr = self.create_ws_mobile_pay(out_trade_no=order.order_no, subject=order.title, body=order.title, total_fee=order.payment_fee, notify_url=notify_url) self.write({"paystr": paystr})
def post(self): order_no = self.get_argument('order_no', None) trade_type = self.get_argument("trade_type", "jsapi") if trade_type.upper() not in ("NATIVE", "JSAPI"): raise ApiException(400, '交易类型不支持') order = TeamOrder.get_or_404(order_no=order_no, user=self.current_user) self.check_order_state(order) wx_order = yield self.handle_wxpay(order, trade_type=trade_type.upper(), body=order.title) self.write(wx_order)