Beispiel #1
0
        public ResponseBaseViewModel <TraRequestConfirmResponseViewModel> GetRequestConfirm([FromBody] TraRequestConfirmViewModel request)
        {
            #region 生产环境,测试帐号不许出票,直接返回
            string testCid = AppSettingsHelper.GetAppSettings(AppSettingsEnum.TestCid);//生产环境,测试帐号不许出票
            if (testCid == this.GetCid().ToString())
            {
                return(new ResponseBaseViewModel <TraRequestConfirmResponseViewModel>()
                {
                    Flag = new ResponseCodeViewModel()
                    {
                        Code = 0
                    },
                    Data = new TraRequestConfirmResponseViewModel()
                    {
                        OrderId = request.OrderId,
                        TransactionId = request.TransactionId
                    }
                });
            }
            #endregion
            factory = new RequestConfirmFactory();
            domain  = factory.CreateDomainObj();
            TraRequestConfirmModel rcModel = new TraRequestConfirmModel()
            {
                transactionid = request.TransactionId,
                orderid       = request.OrderId,
                reqtoken      = DateTime.Now.ToString("yyyyMMddHHmmss"),
                isasync       = (string.IsNullOrEmpty(request.IsAsync) ? "Y" : request.IsAsync),
            };
            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        traOrderDomain     = orderDomainFactory.CreateAddModOrderDomainObj();

            domain.ModComfireEvent += traOrderDomain.DoModComfireEvent;
            var obj = domain.DoRequestConfirm(rcModel);
            domain.ModComfireEvent -= traOrderDomain.DoModComfireEvent;

            var uiModel = new ResponseBaseViewModel <TraRequestConfirmResponseViewModel>();
            var flag    = new ResponseCodeViewModel();
            uiModel.Flag = flag;
            TraRequestConfirmResponseViewModel tmodel = new TraRequestConfirmResponseViewModel()
            {
                OrderId  = obj.orderid,
                ReqToken = obj.reqtoken,

                TransactionId = obj.transactionid
            };

            uiModel.Data = tmodel;
            if (obj.code == 100)
            {
                uiModel.Flag.Code = 0;
            }

            return(uiModel);
        }
        public HttpResponseMessage ModHoldSeatCallBack()
        {
            factory = new ModHoldSeatFactory();
            domain  = factory.CreateDomainObj();
            IOrderDomainFactory orderDomainFactory = new OrderDomainFactory();
            IOrderDomain        traOrderDomain     = orderDomainFactory.CreateAddModOrderDomainObj();

            domain.ModCallBackEvent += traOrderDomain.DoModCallBackEvent;
            domain.DoModHoldSeat();
            domain.ModCallBackEvent -= traOrderDomain.DoModCallBackEvent;



            var response = Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent("SUCCESS", Encoding.UTF8);
            return(response);
        }