Пример #1
0
 public Data(string cpyno)
 {
     try
     {
         this.dataAction = new DataAction();
         BaseDataManage baseDataManager = new BaseDataManage();
         string         No = "000000";
         if (cpyno.Length >= 12)
         {
             No = cpyno.Substring(0, 12);
         }
         List <Bd_Base_Parameters> SupParameters = baseDataManager.CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + No + "'" }) as List <Bd_Base_Parameters>;
         if (SupParameters != null)
         {
             foreach (Bd_Base_Parameters item in SupParameters)
             {
                 if (item.SetName == "setCommission")
                 {
                     CommissionType = int.Parse(item.SetValue);
                     break;
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
 }
Пример #2
0
    /// <summary>
    /// 在线充值
    /// </summary>
    /// <param name="id">订单id</param>
    /// <param name="payWay">支付方式</param>
    /// <param name="code">网银银行代码</param>
    /// <param name="price">充值金额</param>
    private void OnlineRepaymentOrderPay(string id, string payWay, string code, string price)
    {
        string strFromValue = "";
        var    url          = string.Empty;

        try
        {
            PbProject.Logic.Pay.DataAction data         = new PbProject.Logic.Pay.DataAction();
            Tb_Ticket_OrderBLL             ticket_Order = new Tb_Ticket_OrderBLL();
            //string indexId = ticket_Order.GetIndexId();//内部流水号
            string orderId = ticket_Order.GetOrderId("1");//订单编号
            //string payCpyNo = mCompany.UninCode; //付款公司编号

            string payId = mUser != null?mUser.id.ToString() : ""; //付款公司编号

            string act = UseAct(payWay, mUser.CpyNo);              //收款账号

            if (!string.IsNullOrEmpty(payId) && !string.IsNullOrEmpty(act))
            {
                //添加交易日志
                //bool reuslt = new PbProject.Logic.Pay.Bill().InsertLogMoneyDetail(orderId, indexId, price, payWay, mUser, mCompany);

                if (payWay == "1" || payWay == "5")//支付宝
                {
                    #region 支付宝

                    #region 参数赋值

                    decimal total      = decimal.Parse(price);                      //订单支付金额
                    decimal supperates = 0.001M;                                    //支付费率
                    decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                    decimal actPrice   = total - paySXF;                            //收款账号金额
                    string  detail     = act + "^" + actPrice.ToString("F2") + "^充值收款";
                    #endregion

                    AliPayParam aliPayParam = new AliPayParam();
                    aliPayParam.Out_trade_no       = orderId;          //内部订单号
                    aliPayParam.Subject            = "在线充值";           //商品名称
                    aliPayParam.Body               = "在线充值";           //商品描述
                    aliPayParam.Total_fee          = total.ToString(); //订单总价
                    aliPayParam.Royalty_parameters = detail;           //分润参数
                    aliPayParam.Extend_param       = "";               //公用业务扩展参数,支付宝用于 显示 PNR (格式:参数名1^参数值1|参数名2^参数值2|......)
                    aliPayParam.Extra_common_param = payId;            //自定义字段
                    aliPayParam.DefaultBank        = code;             //网银标示

                    strFromValue = new PbProject.Logic.Pay.AliPay().GetPay(aliPayParam);
                    #endregion
                }
                else if (payWay == "2" || payWay == "6")//快钱
                {
                    #region 快钱

                    #region 参数赋值
                    decimal total      = decimal.Parse(price);                      //订单支付金额
                    decimal supperates = 0.001M;                                    //支付费率
                    decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                    decimal actPrice   = total - paySXF;                            //收款账号金额

                    int totalInt    = int.Parse((total * 100).ToString().Split('.')[0]);
                    int paySXFInt   = int.Parse((paySXF * 100).ToString().Split('.')[0]);
                    int actPriceInt = int.Parse((actPrice * 100).ToString().Split('.')[0]);

                    string detail = "1^" + act + "^" + actPriceInt.ToString() + "^0^充值收款";
                    #endregion

                    _99BillParam billParam = new _99BillParam();
                    billParam.Orderid  = orderId;                                    //0.订单编号
                    billParam.Price    = totalInt.ToString();                        //1.订单金额,单位“分”
                    billParam.Money    = paySXFInt.ToString();;                      //2.手续费,单位“分”
                    billParam.Pname    = "在线充值";                                     //3.商品名称
                    billParam.Ext      = payId;                                      //4.自定义字段
                    billParam.Detail   = detail;                                     //5.分润数据集
                    billParam.Ptype    = "1";                                        //6.分润类别,1 立刻分润 0 异步分润
                    billParam.Payid    = "*****@*****.**";;                       //7.付款帐户
                    billParam.Paytype  = (string.IsNullOrEmpty(code)) ? "00" : "10"; //8.  00:组合支付,10:银行卡支付
                    billParam.Bankcode = code;                                       //9: 银行代码
                    strFromValue       = new PbProject.Logic.Pay._99Bill().GetPay(billParam);
                    #endregion
                }
                else if (payWay == "3" || payWay == "7")//汇付天下
                {
                    #region 汇付天下

                    #region 参数赋值
                    decimal total      = decimal.Parse(price);                      //订单支付金额
                    decimal supperates = 0.001M;                                    //支付费率
                    decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                    decimal actPrice   = total - paySXF;                            //收款账号金额
                    string  detail     = "Agent:" + act + ":" + actPrice;
                    #endregion

                    ChinaPnrParam chinaPnrParam = new ChinaPnrParam();
                    chinaPnrParam.Orderid = orderId;              //订单号
                    chinaPnrParam.Price   = total.ToString("f2"); //订单总价
                    chinaPnrParam.Merpriv = payId;                //自定义字段
                    chinaPnrParam.Details = detail;
                    strFromValue          = new PbProject.Logic.Pay.ChinaPnr().Buy(chinaPnrParam);

                    #endregion
                }
                else if (payWay == "4" || payWay == "8" || payWay == "40")// 财付通
                {
                    #region 财付通

                    #region 参数赋值

                    string  actXSF     = UseAct(payWay, mUser.CpyNo.Substring(0, 12)); //手续费收款账号
                    decimal total      = decimal.Parse(price);                         //订单支付金额
                    decimal supperates = 0.001M;                                       //支付费率
                    decimal paySXF     = data.FourToFiveNum(total * supperates, 2);    //支付手续费
                    decimal actPrice   = total - paySXF;                               //收款账号金额

                    total = total * 100;

                    //TenPayParam tenPayParam = new TenPayParam();
                    //tenPayParam.Bus_Args = string.Format("{0}^{1}^1|{2}^{3}^2", act, actPrice, actXSF, paySXF);
                    ////tenPayParam.Bus_Desc = "12345^深圳-上海^1^fady^庄^13800138000";///业务描述,特定格式的字符串,格式为:PNR^航程^机票张数^机票销售商在机票平台的id^联系人姓名^联系电话
                    //tenPayParam.Bus_Desc = "机票充值";
                    //tenPayParam.Desc = "在线充值";
                    //tenPayParam.Orderid = orderId;
                    //tenPayParam.Total_Tee = total.ToString("F0");
                    //tenPayParam.UserHostAddress = Page.Request.UserHostAddress;

                    string queryParam = string.Format("orderid={0}&total_tee={1}&userhostaddress={2}&attach={3}&busargs={4}&busdesc={5}&banktype={6}",
                                                      orderId, total.ToString("F0"), Request.UserHostAddress, mUser.id.ToString(), string.Format("{0}^{1}^1|{2}^{3}^2", act, (actPrice * 100).ToString("F0"), actXSF, (paySXF * 100).ToString("F0")), "在线充值", code);//,string.Format("{0}^{1}^{2}^{3}^{4}^{5}", mOrder.PNR, mOrder.Travel, mOrder.PassengerNumber, mUser.id.ToString(), mOrder.CreateUserName, "13800000000"));
                    url = string.Format("http://lzh.mypb.cn/Pay/TenPay.aspx?{0}", queryParam);

                    //strFromValue = new PbProject.Logic.Pay.TenPay().SplitPayRequest(tenPayParam);

                    #endregion

                    #endregion
                }
            }
            else
            {
                strFromValue = "收款方账号错误!";
            }
        }
        catch (Exception)
        {
            strFromValue = "收款方账号异常!";
        }

        if (!string.IsNullOrEmpty(url))
        {
            Response.Redirect(url);
        }
        if (!string.IsNullOrEmpty(strFromValue))
        {
            OnErrorNew(strFromValue, false);
        }
        Response.Write(strFromValue);
    }
Пример #3
0
    /// <summary>
    /// 机票支付
    /// </summary>
    /// <param name="id">订单</param>
    /// <param name="payWay">支付方式</param>
    /// <param name="code">网银银行代码</param>
    private void TicketOrderPay(string id, string payWay, string code)
    {
        string msgShow = "";
        string url     = string.Empty;

        try
        {
            bool   result     = false;
            string payDetails = "";//分账明细

            #region 获取订单信息

            //PayWay 支付方式:1支付宝、2快钱、3汇付、4财付通、5支付宝网银、6快钱网银 、7汇付网银、8财付通网银、
            //9支付宝pos、10快钱pos、11汇付pos、12财付通pos、13易宝pos、14账户支付、15收银
            //string tempSqlWhere = " OrderId='" + id + "'";

            string tempSqlWhere = " id='" + id + "'";
            List <Tb_Ticket_Order> bParametersList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(tempSqlWhere);
            Tb_Ticket_Order        mOrder          = null;

            if (bParametersList != null && bParametersList.Count == 1)
            {
                mOrder = bParametersList[0];

                #region 判断PNR状态是否取消等,取消就不能支付
                if (mOrder.OrderStatusCode != 1 && mOrder.OrderStatusCode != 9)
                {
                    msgShow = "订单异常,不能支付!";
                }
                #endregion

                if (this.KongZhiXiTong.Contains("|101|"))
                {
                    //超过 1 小时后的订单能支付
                }
                else
                {
                    #region  超过1个小时不能支付
                    if (mOrder.OrderStatusCode == 1)
                    {
                        DateTime dtTime = DateTime.Now;
                        if (dtTime.CompareTo(mOrder.CreateTime.AddHours(1)) > 0)
                        {
                            // 超过1个小时不能支付
                            msgShow = "超过1个小时的订单不能支付,请重新生成订单进行支付!";
                        }
                    }
                    #endregion
                }

                #region 判断PNR状态是否取消等,取消就不能支付

                //扩展参数
                ParamEx pe = new ParamEx();
                pe.UsePIDChannel = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|48|") ? 2 : 0;
                SendInsManage sendins = new SendInsManage(mUser.LoginName, mCompany.UninCode, pe, this.configparam);
                string        ErrMsg;

                if (mOrder.OrderSourceType == 1 && mOrder.A9 != "1")
                {
                    PnrAnalysis.PnrModel PnrModel = sendins.GetPnr(mOrder.PNR, mOrder.Office, out ErrMsg);

                    if (ErrMsg.IndexOf("已被取消") != -1)
                    {
                        msgShow = "此PNR(" + mOrder.PNR + ")状态为异常,请检查PNR状态后再试!";
                    }
                    else if (PnrModel != null && ErrMsg == "")
                    {
                        if (PnrModel.PassengerNameIsCorrent)
                        {
                            if (KongZhiXiTong != null && KongZhiXiTong.Contains("|23|"))
                            {
                                if ((PnrModel._OldPnrContent.Contains("THIS PNR WAS ENTIRELY CANCELLED") && PnrModel._OldPnrContent.ToUpper().Contains(mOrder.PNR.ToUpper())))
                                {
                                    msgShow = "此PNR(" + mOrder.PNR + ")状态为异常,请检查PNR状态后再试!";
                                }
                                else
                                {
                                    string PnrStatus = PnrModel.PnrStatus;
                                    if (string.IsNullOrEmpty(PnrStatus))
                                    {
                                        msgShow = "此PNR(" + mOrder.PNR + ")数据异常,请检查PNR状态后再试!";
                                    }
                                    else
                                    {
                                        if (!PnrStatus.Contains("HK") && !PnrStatus.Contains("DK") && !PnrStatus.Contains("RR") && !PnrStatus.Contains("KK"))
                                        {
                                            msgShow = "此PNR(" + mOrder.PNR + ")状态为:" + PnrStatus + ",请检查PNR状态后再试!";
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            msgShow = "此PNR(" + mOrder.PNR + ")中乘机人名字:" + string.Join(",", PnrModel.ErrorPassengerNameList.ToArray()) + " 不正确!";
                        }
                    }
                }

                #endregion 判断PNR状态是否取消等,取消就不能支付

                if (msgShow == "")
                {
                    mOrder.PayWay = int.Parse(payWay);

                    // 切换支付方式:修改订单账单明细数据
                    result = new PbProject.Logic.Pay.Bill().UpdateOrderAndTicketPayDetail(mOrder);

                    if (result == true)
                    {
                        //获取分账明细
                        payDetails = new PbProject.Logic.Pay.Bill().PayDetails(payWay, mOrder.OrderId);
                        result     = string.IsNullOrEmpty(payDetails) ? false : result;
                    }
                }
            }

            #endregion

            if (result)
            {
                #region 支付

                if (payWay == "1" || payWay == "5")//支付宝
                {
                    #region 支付参数赋值

                    AliPayParam aliPayParam = new AliPayParam();

                    aliPayParam.Body               = "机票订单";
                    aliPayParam.DefaultBank        = code;
                    aliPayParam.Extra_common_param = mUser.id.ToString(); //自定义:操作人id
                    aliPayParam.Out_trade_no       = mOrder.OrderId;
                    aliPayParam.Royalty_parameters = payDetails;          //分账明细
                    aliPayParam.Subject            = "机票订单";
                    aliPayParam.Total_fee          = mOrder.PayMoney.ToString("f2");


                    if ((!string.IsNullOrEmpty(mOrder.A9) && mOrder.A9 == "1") || string.IsNullOrEmpty(mOrder.PNR))
                    {
                        //不检查编码

                        OnErrorNew("不检查编码,PNR:" + mOrder.PNR, false);
                    }
                    else
                    {
                        //需要检查编码
                        #region 判断PNR

                        tempSqlWhere = " PNR='" + mOrder.PNR + "' and OrderStatusCode=4 and (PayWay=1 or PayWay=5)";
                        List <Tb_Ticket_Order> orderListNew = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(tempSqlWhere);

                        if (orderListNew == null || orderListNew.Count == 0)
                        {
                            //先看该订单支付已经支付过
                            aliPayParam.Extend_param = "PNR^" + mOrder.PNR;
                        }
                        else
                        {
                            OnErrorNew("该编码已经有支付记录,PNR:" + mOrder.PNR, false);
                        }

                        #endregion
                    }

                    #endregion

                    msgShow = new PbProject.Logic.Pay.AliPay().GetPay(aliPayParam);
                }
                else if (payWay == "2" || payWay == "6")//快钱
                {
                    PbProject.Logic.Pay.DataAction d = new PbProject.Logic.Pay.DataAction();
                    decimal tempMoney = d.FourToFiveNum(mOrder.PayMoney * 0.001M, 2) * 100; //手续费

                    #region 支付参数赋值
                    _99BillParam billParam = new _99BillParam();
                    billParam.Bankcode = code;
                    billParam.Detail   = payDetails;               //分账明细
                    billParam.Ext      = mUser.id.ToString();      //操作人id
                    billParam.Money    = tempMoney.ToString("f0"); //供应商收款
                    billParam.Orderid  = mOrder.OrderId;
                    //billParam.Payid = "*****@*****.**";
                    billParam.Payid   = "";
                    billParam.Paytype = (string.IsNullOrEmpty(code)) ? "00" : "10";
                    billParam.Pname   = "机票订单";
                    billParam.Price   = (mOrder.PayMoney * 100).ToString("f0"); //供应商收款
                    billParam.Ptype   = "1";

                    #endregion

                    msgShow = new PbProject.Logic.Pay._99Bill().GetPay(billParam);
                }
                else if (payWay == "3" || payWay == "7")//汇付天下
                {
                    #region 支付参数赋值

                    ChinaPnrParam chinaPnrParam = new ChinaPnrParam();
                    chinaPnrParam.Orderid = mOrder.OrderId;                 //订单号
                    chinaPnrParam.Price   = mOrder.PayMoney.ToString("f2"); //订单总价
                    chinaPnrParam.Merpriv = mUser.id.ToString();            //自定义字段
                    chinaPnrParam.Details = payDetails;                     //分账明细
                    chinaPnrParam.Pnr     = mOrder.PNR;

                    #endregion

                    msgShow = new PbProject.Logic.Pay.ChinaPnr().Buy(chinaPnrParam);
                }
                else if (payWay == "4" || payWay == "8" || payWay == "40")// 财付通
                {
                    string queryParam = string.Format("orderid={0}&total_tee={1}&userhostaddress={2}&attach={3}&busargs={4}&busdesc={5}&banktype={6}",
                                                      mOrder.OrderId, (mOrder.PayMoney * 100).ToString("F0"), Request.UserHostAddress, mUser.id.ToString(), payDetails, string.Format("{0}^{1}^{2}^{3}^{4}^{5}", mOrder.PNR, mOrder.Travel, mOrder.PassengerNumber, mUser.id.ToString(), mOrder.CreateUserName, "13800000000"), code);
                    url = string.Format("http://lzh.mypb.cn/Pay/TenPay.aspx?{0}", queryParam);
                    // url = string.Format("TenPay.aspx?{0}", queryParam);
                }

                #endregion
            }
            else
            {
                OnErrorNew("支付错误:" + payDetails, false);

                msgShow = string.IsNullOrEmpty(msgShow) ? "支付错误" : msgShow;
            }
        }
        catch (Exception ex)
        {
            msgShow = "支付异常";

            OnErrorNew(msgShow + ex.ToString(), false);
        }
        if (!string.IsNullOrEmpty(url))
        {
            Response.Redirect(url);
        }
        else
        {
            OnErrorNew(msgShow, false);
            Response.Write(msgShow);
        }
    }
Пример #4
0
    /// <summary>
    /// 短信支付
    /// </summary>
    /// <param name="id">订单id</param>
    /// <param name="payWay">支付方式</param>
    /// <param name="code">网银银行代码</param>
    private void SmsOrderPay(string id, string payWay, string code, string prices)
    {
        string url          = string.Empty;
        string strFromValue = "";

        PbProject.Logic.Pay.DataAction data         = new PbProject.Logic.Pay.DataAction();
        Tb_Ticket_OrderBLL             ticket_Order = new Tb_Ticket_OrderBLL();

        string orderId = id;     //订单编号
        string price   = prices; //订单金额

        //string payCpyNo = mCompany.UninCode; //付款公司编号
        string payId = mUser != null?mUser.id.ToString() : ""; //付款公司编号

        string act = UseAct(payWay, mUser.CpyNo);              //收款账号

        try
        {
            //PayWay 支付方式:1支付宝、2快钱、3汇付、4财付通、5支付宝网银、6快钱网银 、7汇付网银、8财付通网银、
            //9支付宝pos、10快钱pos、11汇付pos、12财付通pos、13易宝pos、14账户支付、15收银
            if (payWay == "1" || payWay == "5")//支付宝
            {
                #region 支付宝

                #region 参数赋值

                decimal total      = decimal.Parse(price);                      //订单支付金额
                decimal supperates = 0.001M;                                    //支付费率
                decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                decimal actPrice   = total - paySXF;                            //收款账号金额
                string  detail     = act + "^" + actPrice.ToString("F2") + "^充值收款";
                #endregion

                AliPayParam aliPayParam = new AliPayParam();
                aliPayParam.Out_trade_no       = orderId;          //内部订单号
                aliPayParam.Subject            = "在线充值";           //商品名称
                aliPayParam.Body               = "在线充值";           //商品描述
                aliPayParam.Total_fee          = total.ToString(); //订单总价
                aliPayParam.Royalty_parameters = detail;           //分润参数
                aliPayParam.Extend_param       = "";               //公用业务扩展参数,支付宝用于 显示 PNR (格式:参数名1^参数值1|参数名2^参数值2|......)
                aliPayParam.Extra_common_param = payId;            //自定义字段
                aliPayParam.DefaultBank        = code;             //网银标示

                strFromValue = new PbProject.Logic.Pay.AliPay().GetPay(aliPayParam);
                #endregion
            }
            else if (payWay == "2" || payWay == "6")//快钱
            {
                #region 快钱

                #region 参数赋值
                decimal total      = decimal.Parse(price);                      //订单支付金额
                decimal supperates = 0.001M;                                    //支付费率
                decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                decimal actPrice   = total - paySXF;                            //收款账号金额

                int totalInt    = int.Parse((total * 100).ToString().Split('.')[0]);
                int paySXFInt   = int.Parse((paySXF * 100).ToString().Split('.')[0]);
                int actPriceInt = int.Parse((actPrice * 100).ToString().Split('.')[0]);

                string detail = "1^" + act + "^" + actPriceInt.ToString() + "^0^充值收款";
                #endregion

                _99BillParam billParam = new _99BillParam();
                billParam.Orderid  = orderId;                                    //0.订单编号
                billParam.Price    = totalInt.ToString();                        //1.订单金额,单位“分”
                billParam.Money    = paySXFInt.ToString();;                      //2.手续费,单位“分”
                billParam.Pname    = "在线充值";                                     //3.商品名称
                billParam.Ext      = payId;                                      //4.自定义字段
                billParam.Detail   = detail;                                     //5.分润数据集
                billParam.Ptype    = "1";                                        //6.分润类别,1 立刻分润 0 异步分润
                billParam.Payid    = "*****@*****.**";;                       //7.付款帐户
                billParam.Paytype  = (string.IsNullOrEmpty(code)) ? "00" : "10"; //8.  00:组合支付,10:银行卡支付
                billParam.Bankcode = code;                                       //9: 银行代码
                strFromValue       = new PbProject.Logic.Pay._99Bill().GetPay(billParam);
                #endregion
            }
            else if (payWay == "3" || payWay == "7")//汇付天下
            {
                #region 汇付天下

                #region 参数赋值
                decimal total      = decimal.Parse(price);                      //订单支付金额
                decimal supperates = 0.001M;                                    //支付费率
                decimal paySXF     = data.FourToFiveNum(total * supperates, 2); //支付手续费
                decimal actPrice   = total - paySXF;                            //收款账号金额
                string  detail     = "Agent:" + act + ":" + actPrice;
                #endregion

                ChinaPnrParam chinaPnrParam = new ChinaPnrParam();
                chinaPnrParam.Orderid = orderId;              //订单号
                chinaPnrParam.Price   = total.ToString("f2"); //订单总价
                chinaPnrParam.Merpriv = payId;                //自定义字段
                chinaPnrParam.Details = detail;
                strFromValue          = new PbProject.Logic.Pay.ChinaPnr().Buy(chinaPnrParam);

                #endregion
            }
            else if (payWay == "4" || payWay == "8")// 财付通
            {
                #region 财付通

                #region 参数赋值
                string  actXSF     = UseAct(payWay, mUser.CpyNo.Substring(0, 12)); //手续费收款账号
                decimal total      = decimal.Parse(price);                         //订单支付金额
                decimal supperates = 0.001M;                                       //支付费率
                decimal paySXF     = data.FourToFiveNum(total * supperates, 2);    //支付手续费
                decimal actPrice   = total - paySXF;                               //收款账号金额
                total = total * 100;
                string busdesc = string.Empty;
                if (paySXF > 0)
                {
                    busdesc = string.Format("{0}^{1}^1|{2}^{3}^2", act, (actPrice * 100).ToString("F0"), actXSF, (paySXF * 100).ToString("F0"));
                }
                else
                {
                    busdesc = string.Format("{0}^{1}^1", act, (actPrice * 100).ToString("F0"));
                }
                //TenPayParam tenPayParam = new TenPayParam();
                //tenPayParam.Bus_Args = act + "^" + actPrice + "^1|";
                //// tenPayParam.Bus_Desc = "12345^深圳-上海^1^fady^庄^13800138000";///业务描述,特定格式的字符串,格式为:PNR^航程^机票张数^机票销售商在机票平台的id^联系人姓名^联系电话
                //tenPayParam.Bus_Desc = "测试";
                //tenPayParam.Desc = "在线充值";
                //tenPayParam.Orderid = orderId;
                //tenPayParam.Total_Tee = total.ToString("F0");
                //tenPayParam.UserHostAddress = Page.Request.UserHostAddress;

                //strFromValue = new PbProject.Logic.Pay.TenPay().SplitPayRequest(tenPayParam);

                string queryParam = string.Format("orderid={0}&total_tee={1}&userhostaddress={2}&attach={3}&busargs={4}&busdesc={5}",
                                                  orderId, total.ToString("F0"), Request.UserHostAddress, mUser.id.ToString(), busdesc, "短信支付");//,string.Format("{0}^{1}^{2}^{3}^{4}^{5}", mOrder.PNR, mOrder.Travel, mOrder.PassengerNumber, mUser.id.ToString(), mOrder.CreateUserName, "13800000000"));
                url = string.Format("http://lzh.mypb.cn/Pay/TenPay.aspx?{0}", queryParam);

                #endregion

                #endregion
            }
            else if (payWay == "14")//账户余额
            {
                #region 账户余额
                if (mCompany != null)
                {
                    List <User_Company> listSmsUser     = baseDataManage.CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + mCompany.UninCode + "'" }) as List <User_Company>;
                    decimal             maxMoney        = listSmsUser[0].MaxDebtMoney;                        //最大欠款额度
                    decimal             oldAccountMoney = listSmsUser[0].AccountMoney;                        // 支付前
                    decimal             newAccountMoney = oldAccountMoney + maxMoney - decimal.Parse(prices); // 支付后

                    if (newAccountMoney >= 0)
                    {
                        PbProject.Logic.Pay.Bill bill = new PbProject.Logic.Pay.Bill();
                        strFromValue = bill.MakeSMS(id, "", 14) == true ? "充值成功" : "充值失败";
                    }
                    else
                    {
                        strFromValue = "账户余额不足";
                    }
                }
                #endregion
            }
        }
        catch (Exception)
        {
            strFromValue = "支付异常";
        }

        if (!string.IsNullOrEmpty(url))
        {
            Response.Redirect(url);
        }
        if (!string.IsNullOrEmpty(strFromValue))
        {
            OnErrorNew(strFromValue, false);
        }

        Response.Write(strFromValue);
    }
Пример #5
0
    /// <summary>
    /// 返回数据
    /// </summary>
    /// <param name="fromcity">起飞城市三字码</param>
    /// <param name="tocity">抵达城市三字码</param>
    /// <param name="totime">起飞时间</param>
    /// <param name="arrtime">抵达时间</param>
    /// <param name="starttime">起飞日期</param>
    /// <param name="cw">舱位</param>
    /// <param name="aircode">航空公司</param>
    /// <param name="aircono">航班号</param>
    /// <param name="fd">返点</param>
    /// <param name="strYh">现返</param>
    /// <param name="hidId">GUID</param>
    /// <param name="Fare">固定特价</param>
    /// <param name="TAX">基建</param>
    /// <param name="RQFare">燃油</param>
    /// <param name="isGuding">是否固定特价</param>
    /// <param name="Yprice">是否固定特价</param>
    private void PlyMatch(string fromcity, string tocity, string totime, string arrtime, string starttime,
                          string cw, string aircode, string aircono, string fd, string strYh, string hidId,
                          string Fare, string TAX, string RQFare, bool isGuding, string Yprice
                          )
    {
        try
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("");
            string[] strValue = new string[4];
            //非固定特价PATA数据
            if (!isGuding)
            {
                #region pat 数据
                // ig|SS MU747/X/30NOV/KMGSHANN1/0730 1025|pat:a&kmg226#1
                //发送指令获取
                DateTime dt      = DateTime.Parse(starttime);
                string   cmd     = "SS " + aircode + aircono + "/" + cw + "/" + dt.ToString("R").Substring(4, 7).Replace(" ", "") + dt.Year.ToString().Substring(2) + "/" + fromcity + tocity + "NN1/" + totime.Replace(":", "") + " " + arrtime.Replace(":", "") + "|pat:a";
                string   zhiling = cmd;
                string   strVale = string.Empty;
                //---------修改部分----------
                if (this.configparam != null)
                {
                    //开启使用特价缓存  true 开启 false关闭
                    bool IsUseSpCache = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|99|");
                    //特价缓存
                    SpecialCabinPriceInfoBLL  SpBll     = new SpecialCabinPriceInfoBLL();
                    Tb_SpecialCabin_PriceInfo PriceInfo = null;
                    if (IsUseSpCache)
                    {
                        SpBll.GetSpPrice(aircode, aircono, DateTime.Parse(starttime + " " + totime + ":00"), fromcity, tocity, cw);
                    }
                    if (PriceInfo == null)
                    {
                        //格式化编码内容类
                        PnrAnalysis.FormatPNR pnrformat = new PnrAnalysis.FormatPNR();
                        //扩展参数
                        ParamEx pe = new ParamEx();
                        pe.UsePIDChannel = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|48|") ? 2 : 0;
                        SendInsManage SendManage = new SendInsManage(mUser.LoginName, mCompany.UninCode, pe, this.configparam);
                        string        Office     = this.configparam.Office.Split('^')[0];
                        strVale = SendManage.Send(cmd, ref Office, 15);//发送获取特价指令
                        string  error = "";
                        decimal spFare = 0m, spABFare = 0m, spRQFare = 0m;
                        //价格实体
                        PnrAnalysis.PatModel Pat = pnrformat.GetPATInfo(strVale, out error);
                        if (Pat != null && Pat.UninuePatList.Count > 0)
                        {
                            strValue[0] = Pat.UninuePatList[0].Fare;   //舱位价
                            strValue[1] = Pat.UninuePatList[0].TAX;    //基建
                            strValue[2] = Pat.UninuePatList[0].RQFare; //燃油
                            strValue[3] = Pat.UninuePatList[0].Price;  //总计(舱位价+基建+燃油)
                            decimal.TryParse(strValue[0], out spFare);
                            decimal.TryParse(strValue[1], out spABFare);
                            decimal.TryParse(strValue[2], out spRQFare);
                        }
                        else
                        {
                            //-----------------2013-5-6添加----------------------------------------------
                            //没有PAT出价格 预订一个编码PAT价格后取消PNR 即使编码没有取消 后台程序自动取消
                            string ErrMsg = "";
                            if (ConfigIsSet(out ErrMsg))
                            {
                                //----------构造航段和乘客---------------
                                List <Tb_Ticket_Passenger> pList      = GetPassengerList();
                                List <Tb_Ticket_SkyWay>    skywaylist = new List <Tb_Ticket_SkyWay>();
                                Tb_Ticket_SkyWay           sky        = new Tb_Ticket_SkyWay();
                                sky.CarryCode    = aircode;
                                sky.FlightCode   = aircono;
                                sky.FromDate     = DateTime.Parse(starttime + " " + totime + ":00");
                                sky.ToDate       = DateTime.Parse(starttime + " " + arrtime + ":00");
                                sky.FromCityCode = fromcity;
                                sky.ToCityCode   = tocity;
                                sky.Space        = cw;
                                skywaylist.Add(sky);

                                //-------------------------
                                //预订编码 获取价格
                                RePnrObj pnrObj      = GetPnrInfo(aircode, pList, skywaylist, out ErrMsg);
                                string   AdultPnr    = string.Empty;
                                Log_Pnr  logAdultPnr = null;
                                //成人预订信息编码记录
                                if (pnrObj.AdultYudingList.Count > 0)
                                {
                                    AdultPnr = pnrObj.AdultPnr;
                                    if (string.IsNullOrEmpty(AdultPnr) || AdultPnr.Trim().Length != 6)
                                    {
                                        AdultPnr = "";
                                    }
                                    //记录编码日志
                                    YuDingPnrLog(pnrObj, pnrObj.AdultYudingList.Keys[0], pnrObj.AdultYudingList.Values[0], AdultPnr, pnrObj.Office, out logAdultPnr);
                                }
                                if (!string.IsNullOrEmpty(pnrObj.AdultPnr))
                                {
                                    //取消编码
                                    if (SendManage.CancelPnr(pnrObj.AdultPnr, pnrObj.Office))
                                    {
                                        if (logAdultPnr != null)
                                        {
                                            //修改状态
                                            logAdultPnr.Flag = true;
                                            string tempSql = PbProject.Dal.Mapping.MappingHelper <Log_Pnr> .CreateUpdateModelSql(logAdultPnr, "id");

                                            this.baseDataManage.ExecuteNonQuerySQLInfo(tempSql);
                                        }
                                    }
                                }
                                //获取价格
                                if (pnrObj.PatModelList != null && pnrObj.PatModelList.Length > 0)
                                {
                                    Pat = pnrObj.PatModelList[0];
                                    if (Pat != null && Pat.UninuePatList.Count > 0)
                                    {
                                        strValue[0] = Pat.UninuePatList[0].Fare;   //舱位价
                                        strValue[1] = Pat.UninuePatList[0].TAX;    //基建
                                        strValue[2] = Pat.UninuePatList[0].RQFare; //燃油
                                        strValue[3] = Pat.UninuePatList[0].Price;  //总计(舱位价+基建+燃油)
                                        decimal.TryParse(strValue[0], out spFare);
                                        decimal.TryParse(strValue[1], out spABFare);
                                        decimal.TryParse(strValue[2], out spRQFare);
                                    }
                                }
                            }
                            //---------------------------------------------------------------
                        }
                        if (spFare != 0m)
                        {
                            //存入缓存
                            SpBll.SaveSpPrice(aircode.ToUpper(), aircono, DateTime.Parse(starttime + " " + totime + ":00"), fromcity, tocity, cw, spFare, spABFare, spRQFare);
                        }
                    }
                    else
                    {
                        strValue[0] = PriceInfo.SpPrice.ToString();  //舱位价
                        strValue[1] = PriceInfo.SpABFare.ToString(); //基建
                        strValue[2] = PriceInfo.SpRQFare.ToString(); //燃油
                        strValue[3] = (PriceInfo.SpPrice + PriceInfo.SpABFare + PriceInfo.SpRQFare).ToString();
                    }
                }
                #endregion
            }
            else
            {
                strValue[0] = Fare;   //舱位价
                strValue[1] = TAX;    //基建
                strValue[2] = RQFare; //燃油
                strValue[3] = (decimal.Parse(Fare) + decimal.Parse(TAX) + decimal.Parse(RQFare)).ToString();
            }

            //实付金额
            string sjvalue = new PbProject.Logic.Pay.Data(this.mCompany.UninCode).CreatePassengerPayFee(decimal.Parse(strValue[0]), decimal.Parse(strValue[1]), decimal.Parse(strValue[2]), decimal.Parse(fd), decimal.Parse(strYh), 1).ToString();
            string pyj     = new PbProject.Logic.Pay.Data(this.mCompany.UninCode).CreateCommissionCG(decimal.Parse(strValue[0]), decimal.Parse(fd)).ToString();

            string ZK = "";
            if (Yprice != "0")//如果传的有Y舱价格,则是特价类型的,则计算折扣
            {
                PbProject.Logic.Pay.DataAction plpd = new PbProject.Logic.Pay.DataAction();
                //特价时候需要计算折扣,让前台计算加入哪一个折扣范围
                decimal tempFare = 0;
                decimal.TryParse(strValue[0], out tempFare);
                decimal tempYprice = 0;
                decimal.TryParse(Yprice, out tempYprice);
                //计算特价的折扣
                ZK = (new PbProject.Logic.Pay.DataAction().FourToFiveNum((tempFare / tempYprice), 4) * 100).ToString("f2");
                decimal tempZK = 0;
                decimal.TryParse(ZK, out tempZK);
                ZK = plpd.FourToFiveNum(tempZK, 0).ToString();
            }


            if (strValue[0] != "" || strValue[1] != "" || strValue[2] != "" || strValue[3] != "")
            {
                decimal tempPrice = 0;
                decimal.TryParse(strValue[0], out tempPrice);


                #region  pat 有数据
                sb.Append(tempPrice.ToString("f0") + "@"); //0
                sb.Append(strValue[1] + "@");              //1
                sb.Append(strValue[2] + "@");              //2
                sb.Append(strValue[3] + "@");              //3
                sb.Append(sjvalue + "@");                  //4
                sb.Append(pyj + "@");                      //5
                sb.Append(hidId + "@");                    //6
                sb.Append(ZK);                             //7
                #endregion
            }
            else
            {
                #region pat 没有数据
                sb.Append("@"); //0
                sb.Append("@"); //1
                sb.Append("@"); //2
                sb.Append("@"); //3
                sb.Append("@"); //4
                sb.Append("@"); //5
                sb.Append("@"); //6
                sb.Append("@"); //7

                #endregion pat 出来没有数据
            }

            //最终sb格式 0舱位价@1基建@2燃油@3总计(舱位价+基建+燃油)@4实付金额@5佣金@6guid@7特价计算的折扣
            Response.Write(sb.ToString());
            //Response.Write("");
        }
        catch (Exception ex)
        {
            Response.Write("");
        }
    }