Пример #1
0
        public ActionResult SaveBooking(string plateNo, string parkingId, string areaId, DateTime startTime, DateTime endTime)
        {
            try
            {
                WXReserveBitResult result = PkBitBookingServices.WXReservePKBit(WeiXinUser.AccountID, string.Empty, parkingId, areaId, plateNo, startTime, endTime);
                if (result.code == 0)
                {
                    if (parkingId != result.Order.PKID)
                    {
                        throw new MyException("车场编号不一致");
                    }

                    BaseParkinfo parking = ParkingServices.QueryParkingByParkingID(parkingId);
                    if (parking == null)
                    {
                        throw new MyException("获取车场信息失败");
                    }
                    ViewBag.ParkingName = parking.PKName;

                    ParkArea area = ParkAreaServices.QueryByRecordId(areaId);
                    if (area == null)
                    {
                        throw new MyException("获取区域信息失败");
                    }
                    ViewBag.AreaName  = area.AreaName;
                    ViewBag.PlateNo   = plateNo;
                    ViewBag.StartTime = startTime.ToString("yyyy-MM-dd HH:mm:ss");
                    ViewBag.EndTime   = endTime.ToString("yyyy-MM-dd HH:mm:ss");
                    ViewBag.AreaId    = areaId;
                    return(View(result));
                }
                if (result.code == 1)
                {
                    throw new MyException("您已经预约过了,请勿重复预约");
                }
                throw new MyException("预约失败[" + result.message + "]");
            }
            catch (MyException ex) {
                return(PageAlert("Index", "ParkBitBooking", new { RemindUserContent = ex.Message }));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptionToDbAndTxt("WeiXinWeb", "预约失败", ex, LogFrom.WeiXin);
                return(PageAlert("Index", "ParkBitBooking", new { RemindUserContent = "预约失败!" }));
            }
        }
Пример #2
0
        public ActionResult BitBookingRecord()
        {
            List <ParkReserveBit> models = PkBitBookingServices.WXReserveBitPay(WeiXinUser.AccountID);

            return(View(models));
        }
Пример #3
0
        /// <summary>
        /// 同步支付结果
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="payTime"></param>
        private static bool SyncNoticePayResult(decimal orderId, DateTime payTime, OnlineOrder order, out string payDetailId)
        {
            payDetailId = string.Empty;
            int payWay = GetServicePayWay(order.PaymentChannel);

            switch (order.OrderType)
            {
            case OnlineOrderType.MonthCardRecharge:
            {
                MonthlyRenewalResult renewalsResult = RechargeService.WXMonthlyRenewals(order.CardId, order.PKID, order.MonthNum, order.Amount, order.AccountID, payWay, OrderSource.WeiXin, order.OrderID.ToString(), payTime);
                if (renewalsResult.Result != APPResult.Normal)
                {
                    throw new MyException(SyncResultDescription(renewalsResult.Result));
                }
                payDetailId = renewalsResult.Pkorder != null?renewalsResult.Pkorder.OnlineOrderNo.ToString() : string.Empty;

                return(true);
            }

            case OnlineOrderType.ParkFee:
            {
                if (order.OrderSource == PayOrderSource.BWY)
                {
                    BWYOrderPaymentResult result = BWYInterfaceProcess.PayNotice((int)(order.Amount * 100), order.ExternalPKID, order.PayDetailID.ToString());
                    if (result.Result != 0)
                    {
                        throw new MyException(result.Desc);
                    }
                }
                else if (order.OrderSource == PayOrderSource.SFM)
                {
                    bool isPayScene = !string.IsNullOrWhiteSpace(order.TagID);
                    TxtLogServices.WriteTxtLogEx("SFMError", string.Format("isPayScene:{0}", isPayScene));
                    SFMResult result = SFMInterfaceProcess.PayNotify(order.InOutID, order.SerialNumber, order.Amount.ToString(), isPayScene);
                    if (result == null)
                    {
                        throw new MyException("请求赛菲姆支付通知失败");
                    }
                    if (!result.Success)
                    {
                        throw new MyException(string.Format("{0}【{1}】", result.Message, result.Code));
                    }
                }
                else
                {
                    TempStopPaymentResult result = RechargeService.WXTempStopPayment(order.PayDetailID, payWay, order.Amount, order.PKID, order.AccountID, order.OrderID.ToString(), payTime);
                    if (result.Result != APPResult.Normal)
                    {
                        throw new MyException(SyncResultDescription(result.Result));
                    }
                }
                return(true);
            }

            case OnlineOrderType.PkBitBooking:
            {
                return(PkBitBookingServices.WXReserveBitPay(order.CardId, order.PayDetailID, order.Amount, order.PKID, order.OrderID.ToString()));
            }

            case OnlineOrderType.SellerRecharge:
            {
                return(SyncSellerRecharge(order, (OrderPayWay)payWay));
            }

            case OnlineOrderType.APPRecharge:
            {
                return(1 == AppBalanceNotify.BalanceRechargeNotify(order.OrderID.ToString(), order.PlateNo, order.Amount));
            }

            default: throw new MyException("同步类型不存在");
            }
        }