Ejemplo n.º 1
0
        /// <summary>
        /// 开启订单支付
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        private async Task <BaseApiResponse> StartPayment(Guid orderId)
        {
            var order = _orderQueryService.FindOrder(orderId);

            if (order == null)
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "没有该预定单"
                });
            }
            if (order.Status == (int)OrderStatus.PaymentSuccess || order.Status == (int)OrderStatus.Success)
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "预定单已经付款或完成"
                });
            }
            if (order.ReservationExpirationDate.HasValue && order.ReservationExpirationDate < DateTime.Now)
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "预订单已经过期,请重新预定"
                });
            }
            //if (order.IsFreeOfCharge)
            //{
            //    //免支付订单,直接设置成功
            //    return await CompleteRegistrationWithoutPayment(orderId, order.GoodsId);
            //}
            //要通过支付完成预订单
            return(await CompleteRegistrationWithThirdPartyProcessorPayment(order));
        }
Ejemplo n.º 2
0
        public ActionResult Display(Guid orderId)
        {
            var order = OrderQueryService.FindOrder(orderId);

            if (order == null)
            {
                return(RedirectToAction("Find", new { conferenceCode = this.ConferenceCode }));
            }
            return(View(order));
        }
Ejemplo n.º 3
0
        public RedirectToRouteResult AssignSeatsForOrder(Guid orderId)
        {
            var order = OrderQueryService.FindOrder(orderId);

            if (order == null)
            {
                return(RedirectToAction("Display", new { orderId }));
            }

            return(RedirectToAction("AssignSeats", new { assignmentsId = order.OrderId }));
        }