Ejemplo n.º 1
0
        public bool IsPaid(string areaCity, string orderId, string outOrderId, string pnr)
        {
            bool                isPaid      = false;
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _TodayAccountInfo   accountInfo = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsPayStatus = m_PTService.PT_TodayGetPayStatus(accountInfo._todayAccout2, outOrderId);

            if (dsPayStatus != null && dsPayStatus.Tables.Count > 0 &&
                dsPayStatus.Tables.Contains("Result") &&
                dsPayStatus.Tables["Result"].Columns.Contains("Status") &&
                dsPayStatus.Tables["Result"].Rows.Count > 0
                )
            {
                if (dsPayStatus.Tables["Result"].Rows[0]["Status"].ToString() == "T")
                {
                    isPaid = true;
                }
            }
            else
            {
                throw new OrderCommException("未获取到" + this.Code + "订单代付状态");
            }
            return(isPaid);
        }
Ejemplo n.º 2
0
        public void CancelOrder(string areaCity, string outOrderId, string pnr, string CancelRemark, string passengerName)
        {
            string              FailMessage   = string.Empty;
            PlatSystem          platSystem    = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _517AccountInfo     accountInfo   = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService   = new PTServiceSoapClient();
            DataSet             dsCancelOrder = m_PTService.PT_517CancelOrder(accountInfo._517Accout, accountInfo._517Password, accountInfo._517Ag, outOrderId);

            if (dsCancelOrder != null && dsCancelOrder.Tables.Contains("Result") &&
                dsCancelOrder.Tables["Result"].Rows.Count > 0 &&
                dsCancelOrder.Tables["Result"].Rows[0]["Success"].ToString().ToUpper() == "TRUE" &&
                dsCancelOrder.Tables["Result"].Rows[0]["OrderID"].ToString().Trim() == outOrderId.Trim()
                )
            {
                //取消成功
            }
            else
            {
                FailMessage = "取消订单失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new OrderCommException(ErrToMessage(FailMessage));
            }
        }
Ejemplo n.º 3
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _TodayAccountInfo   accountInfo = GetInfo(platSystem, areaCity);
            string              FailMessage = string.Empty;
            string              result      = string.Empty;
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrderInfo = m_PTService.PT_TodayGetOrderInfo(accountInfo._todayAccout2, outOrderId);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Contains("Response") &&
                dsOrderInfo.Tables["Response"].Rows.Count > 0 &&
                dsOrderInfo.Tables["Response"].Columns.Contains("Status")
                )
            {
                //成功
                result = getOrderStatus(dsOrderInfo.Tables["Response"].Rows[0]["Status"].ToString());
            }
            else
            {
                FailMessage = "获取订单状态失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new PayInterfaceOrderException(ErrToMessage(FailMessage));
            }
            return(result);
        }
Ejemplo n.º 4
0
        public Dictionary <string, string> AutoCompositeTicket(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem                  platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _517AccountInfo             accountInfo = GetInfo(platSystem, areaCity);
            Dictionary <string, string> resultDic   = new Dictionary <string, string>();
            PTServiceSoapClient         m_PTService = new PTServiceSoapClient();
            DataSet dsOrderInfo = m_PTService.PT_517GetOrderInfo(accountInfo._517Accout, accountInfo._517Password, accountInfo._517Ag, outOrderId, pnr);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Count > 0 &&
                dsOrderInfo.Tables.Contains("Passenger") &&
                dsOrderInfo.Tables["Passenger"].Columns.Contains("Name") &&
                dsOrderInfo.Tables["Passenger"].Rows.Count > 0 &&
                dsOrderInfo.Tables["OrderInfo"].Rows.Count > 0
                )
            {
                DataRowCollection drs      = dsOrderInfo.Tables["Passenger"].Rows;
                string            ticketNo = "";
                foreach (DataRow dr in drs)
                {
                    ticketNo = dr["TicketNo"].ToString().Trim().Replace("--", "-");
                    if (ticketNo != "")
                    {
                        if (ticketNo.Contains("-") && ticketNo.Split('-').Length == 2 && ticketNo.Split('-')[1].Trim() == "")
                        {
                            continue;
                        }
                        if (!resultDic.ContainsKey(dr["Name"].ToString().ToUpper()))
                        {
                            resultDic.Add(dr["Name"].ToString().ToUpper(), ticketNo);
                        }
                    }
                }
            }
            return(resultDic);
        }
Ejemplo n.º 5
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _8000YIAccountInfo  accountInfo = GetInfo(platSystem, areaCity);
            string              FailMessage = string.Empty;
            string              result      = string.Empty;
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrderInfo = m_PTService.PT_8000YIGetOrderStatusInfo(accountInfo._8000yiAccout, accountInfo._8000yiPassword, outOrderId);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Count > 0 &&
                dsOrderInfo.Tables[0].Rows.Count > 0)
            {
                //成功
                result = dsOrderInfo.Tables[0].Rows[0]["a9"].ToString();
            }
            else
            {
                //失败
                FailMessage = "获取订单状态失败";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new OrderCommException(ErrToMessage(FailMessage));
            }
            return(result);
        }
Ejemplo n.º 6
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            string              result      = string.Empty;
            string              FailMessage = string.Empty;
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _YeeXingAccountInfo accountInfo = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrderInfo = m_PTService.PT_YeeXingQueryOrderStatus(accountInfo._yeeXingAccout2, orderId, outOrderId);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Contains("result") &&
                dsOrderInfo.Tables["result"].Rows.Count > 0 &&
                dsOrderInfo.Tables["result"].Columns.Contains("ordstate")
                )
            {
                if (dsOrderInfo.Tables["result"].Rows[0]["is_success"].ToString().ToUpper() == "T")
                {
                    //成功
                    result = dsOrderInfo.Tables["result"].Rows[0]["ordstate"].ToString();
                }
                else
                {
                    result = "获取订单状态失败:" + dsOrderInfo.Tables["result"].Rows[0]["error"].ToString();
                }
            }
            else
            {
                FailMessage = "获取订单状态失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new PayInterfaceOrderException(ErrToMessage(FailMessage));
            }
            return(result);
        }
Ejemplo n.º 7
0
        public void CancelOrder(string areaCity, string outOrderId, string pnr, string CancelRemark, string passengerName)
        {
            string              FailMessage   = string.Empty;
            PlatSystem          platSystem    = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _YeeXingAccountInfo accountInfo   = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService   = new PTServiceSoapClient();
            DataSet             dsCancelOrder = m_PTService.PT_YeeXingCancelOrder(accountInfo._yeeXingAccout2, outOrderId, passengerName, accountInfo._cancel_notify_url);

            if (dsCancelOrder != null && dsCancelOrder.Tables.Contains("result") &&
                dsCancelOrder.Tables["result"].Rows.Count > 0 &&
                dsCancelOrder.Tables["result"].Columns.Contains("is_success") &&
                dsCancelOrder.Tables["result"].Rows[0]["is_success"].ToString().ToUpper() == "T"
                )
            {
                //成功
            }
            else
            {
                FailMessage = "取消订单失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new PayInterfaceOrderException(ErrToMessage(FailMessage));
            }
        }
Ejemplo n.º 8
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            string              result      = string.Empty;
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _51BookAccountInfo  accountInfo = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            string              FailMessage = string.Empty;
            DataSet             dsOrderInfo = m_PTService.PT_51BookGetOrderInfo(accountInfo._51bookAccout, outOrderId, accountInfo._statusType, accountInfo._51bookAg);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Count > 0 &&
                dsOrderInfo.Tables[0].Rows.Count > 0)
            {
                if (dsOrderInfo.Tables[0].Columns.Contains("orderStatus"))
                {
                    result = dsOrderInfo.Tables[0].Rows[0]["orderStatus"].ToString();
                }
                else if (dsOrderInfo.Tables[0].Columns.Contains("ErorrMessage"))
                {
                    FailMessage = dsOrderInfo.Tables[0].Rows[0]["ErorrMessage"].ToString();
                }
            }
            else
            {
                FailMessage = "获取订单状态失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new OrderCommException(ErrToMessage(FailMessage));
            }
            return(result);
        }
Ejemplo n.º 9
0
        public void CancelOrder(string areaCity, string outOrderId, string pnr, string cancelRemark, string passengerName)
        {
            string              FailMessage   = string.Empty;
            PlatSystem          platSystem    = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _51BookAccountInfo  accountInfo   = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService   = new PTServiceSoapClient();
            DataSet             dsCancelOrder = m_PTService.PT_51bookCancelOrder(accountInfo._51bookAccout, accountInfo._51bookAg, outOrderId);

            if (dsCancelOrder != null && dsCancelOrder.Tables.Contains("QueryOrderStatus") &&
                dsCancelOrder.Tables["QueryOrderStatus"].Rows.Count > 0
                )
            {
                if (dsCancelOrder.Tables["QueryOrderStatus"].Rows[0]["CancelStatus"].ToString().ToUpper().Trim() == "T")
                {
                    //成功
                }
                else
                {
                    FailMessage = dsCancelOrder.Tables["QueryOrderStatus"].Rows[0]["Err"].ToString();
                }
            }
            else
            {
                FailMessage = "取消订单失败!";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new OrderCommException(ErrToMessage(FailMessage));
            }
        }
Ejemplo n.º 10
0
        public PlatformOrder CreateOrder(string pnrContent, bool IsLowPrice, string areaCity, string policyId, string RateId, string localOrderId, decimal policyPoint, decimal ReturnMoney, BPiaoBao.Common.PnrData pnrData)
        {
            PlatformOrder      platformOrder = null;
            string             FailMessage   = string.Empty;
            PlatSystem         platSystem    = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _BaiTuoAccountInfo accountInfo   = GetInfo(platSystem, areaCity);
            string             _SsrCardType  = "1";
            string             _IsLowerPrice = IsLowPrice ? "1" : "0";

            pnrContent = System.Web.HttpUtility.UrlEncode(pnrContent);
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrder     = m_PTService.PT_BaiTuoCreateOrder(accountInfo._baiTuoAccout, accountInfo._baiTuoPassword, accountInfo._baiTuoAg, _IsLowerPrice, policyId, localOrderId, _SsrCardType, policyPoint.ToString(), accountInfo._LinkMan, accountInfo._LinkManPhone, pnrContent);

            //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
            //DataSet dsOrder = m_PTService.PT_NewBaiTuoCreateOrder(_baiTuoAccout, _baiTuoPassword, _baiTuoAg, _IsLowerPrice, policyId, localOrderId, _SsrCardType, policyPoint.ToString(), _LinkMan, _LinkManPhone, pnrContent, PTPnrData);
            if (dsOrder != null && dsOrder.Tables.Count > 0 && dsOrder.Tables.Contains(Code))
            {
                DataRow dr = dsOrder.Tables[Code].Rows[0];
                if (dsOrder.Tables[Code].Rows[0]["Status"].ToString() == "T")
                {
                    //成功 获取数据
                    platformOrder = new PlatformOrder();
                    decimal TotlePaidPirce = 0m, TotaSeatlPrice = 0m;
                    decimal.TryParse(dr["PaidTotlePirce"].ToString(), out TotlePaidPirce);
                    decimal.TryParse(dr["SeatTotalPrice"].ToString(), out TotaSeatlPrice);

                    platformOrder.OrderId        = localOrderId;
                    platformOrder.TotlePaidPirce = TotlePaidPirce;
                    platformOrder.TotaSeatlPrice = TotaSeatlPrice;
                    platformOrder.OutOrderId     = dr["OutOrderId"].ToString();
                    platformOrder.PnrCode        = dr["Pnr"].ToString();
                    platformOrder.AreaCity       = areaCity;
                }
                else
                {
                    //失败
                    FailMessage = dr["Message"].ToString() + " 失败";
                    //FailMessage = "生成订单失败!";
                }
            }
            else
            {
                //异常 或超时
                FailMessage = "调用接口超时";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new CreateInterfaceOrderException(ErrToMessage(FailMessage));
            }
            return(platformOrder);
        }
Ejemplo n.º 11
0
        public void Pay(string areaCity, PlatformOrder order)
        {
            PlatSystem        platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _TodayAccountInfo accountInfo = GetInfo(platSystem, areaCity);

            if (accountInfo._PayWay == "0")
            {
                order.PaidMethod = EnumPaidMethod.支付宝;
            }
            else if (accountInfo._PayWay == "1")
            {
                order.PaidMethod = EnumPaidMethod.快钱;
            }
            else if (accountInfo._PayWay == "2")
            {
                order.PaidMethod = EnumPaidMethod.财付通;
            }
            string OutOrderId = order.OutOrderId;
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsPayOrder  = m_PTService.PT_JinRiOrderPay(accountInfo._todayAccout, accountInfo._todayAccout2, OutOrderId);
            string FailMessage = string.Empty;

            if (dsPayOrder != null && dsPayOrder.Tables.Count > 0 && dsPayOrder.Tables.Contains(Code))
            {
                DataRow dr = dsPayOrder.Tables[Code].Rows[0];
                if (dsPayOrder.Tables[Code].Rows[0]["Status"].ToString() == "T")
                {
                    //成功 获取数据
                    Logger.WriteLog(LogType.INFO, this.Code + "接口订单(" + order.OutOrderId + ")代付成功,订单号:" + order.OrderId);
                }
                else
                {
                    //失败
                    FailMessage = dr["Message"].ToString() + " 失败";
                }
            }
            else
            {
                //异常 或超时
                FailMessage = "调用支付接口超时";
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new PayInterfaceOrderException(ErrToMessage(FailMessage));
            }
        }
Ejemplo n.º 12
0
        public Dictionary <string, string> AutoCompositeTicket(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem                  platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _YeeXingAccountInfo         accountInfo = GetInfo(platSystem, areaCity);
            Dictionary <string, string> resultDic   = new Dictionary <string, string>();
            PTServiceSoapClient         m_PTService = new PTServiceSoapClient();
            DataSet dsOrderInfo = m_PTService.PT_YeeXingOrderQueryInfo(accountInfo._yeeXingAccout, accountInfo._yeeXingAccout2, outOrderId, orderId);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Contains("result") &&
                dsOrderInfo.Tables["result"].Rows.Count > 0 &&
                dsOrderInfo.Tables["result"].Columns.Contains("ordstate")
                )
            {
                //暂时未完成
            }
            return(resultDic);
        }
Ejemplo n.º 13
0
        public Dictionary <string, string> AutoCompositeTicket(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem                  platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _TodayAccountInfo           accountInfo = GetInfo(platSystem, areaCity);
            Dictionary <string, string> resultDic   = new Dictionary <string, string>();
            string FailMessage = string.Empty;
            string result      = string.Empty;
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrderInfo = m_PTService.PT_TodayGetOrderInfo(accountInfo._todayAccout2, outOrderId);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Contains("Response") &&
                dsOrderInfo.Tables["Response"].Rows.Count > 0 &&
                dsOrderInfo.Tables["Response"].Columns.Contains("PName") &&
                dsOrderInfo.Tables["Response"].Columns.Contains("TicketNo")
                )
            {
                string[] passengers = dsOrderInfo.Tables["Response"].Rows[0]["PName"].ToString().Split('|');
                string[] ticketNos  = dsOrderInfo.Tables["Response"].Rows[0]["TicketNo"].ToString().Split('|');
                string   ticketNo   = "";
                if (passengers.Length == ticketNos.Length)
                {
                    for (int i = 0; i < passengers.Length; i++)
                    {
                        if (passengers[i].Trim() != "" && ticketNos[i].Trim() != "")
                        {
                            ticketNo = ticketNos[i].ToString().Replace("--", "-");
                            if (ticketNo.Contains("-") && ticketNo.Split('-').Length == 2 && ticketNo.Split('-')[1].Trim() == "")
                            {
                                continue;
                            }
                            if (!resultDic.ContainsKey(passengers[i].Trim().ToUpper()))
                            {
                                resultDic.Add(passengers[i].Trim().ToUpper(), ticketNo);
                            }
                        }
                    }
                }
            }
            return(resultDic);
        }
Ejemplo n.º 14
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _517AccountInfo     accountInfo = GetInfo(platSystem, areaCity);
            string              result      = string.Empty;
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            DataSet             dsOrderInfo = m_PTService.PT_517GetOrderInfo(accountInfo._517Accout, accountInfo._517Password, accountInfo._517Ag, outOrderId, pnr);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Count > 0 &&
                dsOrderInfo.Tables.Contains("OrderInfo") &&
                dsOrderInfo.Tables["OrderInfo"].Columns.Contains("OrderStatus") &&
                dsOrderInfo.Tables["OrderInfo"].Rows.Count > 0
                )
            {
                result = dsOrderInfo.Tables["OrderInfo"].Rows[0]["OrderStatus"].ToString();
            }
            else
            {
                throw new OrderCommException("获取订单状态失败!");
            }
            return(result);
        }
Ejemplo n.º 15
0
        public void CancelOrder(string areaCity, string outOrderId, string pnr, string CancelRemark, string passengerName)
        {
            string              FailMessage = string.Empty;
            PlatSystem          platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _8000YIAccountInfo  accountInfo = GetInfo(platSystem, areaCity);
            PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            string              result      = m_PTService.PT_8000YICancelOrderNew(accountInfo._8000yiAccout, accountInfo._8000yiPassword, outOrderId);

            if (result.Trim().ToLower().StartsWith("true"))
            {
                //成功
            }
            else
            {
                //失败
                FailMessage = result;
            }
            if (!string.IsNullOrEmpty(FailMessage))
            {
                throw new OrderCommException(ErrToMessage(FailMessage));
            }
        }
Ejemplo n.º 16
0
        public string GetOrderStatus(string areaCity, string orderId, string outOrderId, string pnr)
        {
            string               result      = string.Empty;
            PlatSystem           platSystem  = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            _PiaoMengAccountInfo accountInfo = GetInfo(platSystem, areaCity);
            PTServiceSoapClient  m_PTService = new PTServiceSoapClient();
            DataSet              dsOrderInfo = m_PTService.PT_PMOrderQuery(outOrderId, accountInfo._pmAccout, accountInfo._pmAg);

            if (dsOrderInfo != null && dsOrderInfo.Tables.Count > 0 &&
                dsOrderInfo.Tables.Contains("resp") &&
                dsOrderInfo.Tables["resp"].Columns.Contains("status") &&
                dsOrderInfo.Tables["resp"].Rows.Count > 0
                )
            {
                result = getOrderStatus(dsOrderInfo.Tables["resp"].Rows[0]["status"].ToString());
            }
            else
            {
                throw new OrderCommException("获取订单状态失败!");
            }
            return(result);
        }