protected void Page_Load(object sender, EventArgs e) { B_ARoleAuth.CheckEx(ZLEnum.Auth.other, "PayManage"); if (!IsPostBack) { DDLPayPlat.Items.Add(new ListItem("线下支付", "99")); DDLPayPlat.Items.Add(new ListItem("支付宝[即时到帐]", "12")); DDLPayPlat.Items.Add(new ListItem("支付宝实物双工", "1")); DDLPayPlat.Items.Add(new ListItem("支付宝货到付款", "100")); DDLPayPlat.Items.Add(new ListItem("微信支付", "21")); DDLPayPlat.Items.Add(new ListItem("快钱支付", "2")); DDLPayPlat.Items.Add(new ListItem("网银在线", "3")); DDLPayPlat.Items.Add(new ListItem("中国银联", "9")); DDLPayPlat.Items.Add(new ListItem("汇付天下", "13")); DDLPayPlat.Items.Add(new ListItem("易宝支付", "5")); DDLPayPlat.Items.Add(new ListItem("重庆摩宝", "16")); DDLPayPlat.Items.Add(new ListItem("财付通", "4")); DDLPayPlat.Items.Add(new ListItem("Bfopay宝付", "22")); DDLPayPlat.Items.Add(new ListItem("江西工行", "23")); DDLPayPlat.Items.Add(new ListItem("江西建行", "26")); DDLPayPlat.Items.Add(new ListItem("双乾支付", "24")); DDLPayPlat.Items.Add(new ListItem("贝付通", "25")); DDLPayPlat.Items.Add(new ListItem("汇潮支付", "27")); //DDLPayPlat.Items.Add(new ListItem("微信公众号支付","28")); //DDLPayPlat.Items.Add(new ListItem("微信APP支付", 29)); //15为支付宝网银不显示 //商户ID=私钥,证书等放根目录 DDLPayPlat.SelectedValue = "12"; if (Mid > 0) { M_PayPlat info = bll.GetPayPlatByid(Mid); if (info.PayClass == (int)M_PayPlat.Plat.WXPay)//微信支付跳转 { Response.Redirect("../WeiXin/PayWeiXin.aspx"); return; } DDLPayName.Text = info.PayPlatName; DDLPayPlat.SelectedValue = info.PayClass.ToString(); TxtAccountID.Text = info.AccountID; TxtMD5Key.Text = info.MD5Key; TxtSellerEmail.Text = info.SellerEmail; //TxtRate.Text = info.Rate.ToString(); txtRemark.Text = info.PayPlatinfo; PrivateKey_T.Text = info.PrivateKey; PublicKey_T.Text = info.PublicKey; Other_T.Text = info.Other; IsDisabled.Checked = !info.IsDisabled; LblTitle.Text = "修改支付平台"; } else { LblTitle.Text = "添加支付平台"; } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li><a href='PayPlatManage.aspx'>在线支付平台</a></li><li class='active'>" + LblTitle.Text + "</li>"); } }
protected string getPayPlat(string id) { M_PayPlat platMod = prell.GetPayPlatByid(DataConverter.CLng(id)); if (platMod == null) { return(""); } return(platMod.PayPlatName); }
protected string getPayPlat(string id) { var payplat = prell.GetPayPlatByid(DataConverter.CLng(id)); if (payplat == null) { return(""); } return(payplat.PayPlatName); }
protected string getPayPlat(string id) { string result = ""; M_PayPlat payMod = payBll.GetPayPlatByid(DataConverter.CLng(id)); if (payMod != null) { result = payMod.PayPlatName; } return(result); }
protected void Egv_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int payplatid = DataConverter.CLng(e.Row.Cells[0].Text); M_PayPlat plat = bll.GetPayPlatByid(payplatid); if (plat.IsDefault) { LinkButton btn1 = (LinkButton)e.Row.FindControl("LinkButton1"); LinkButton btn3 = (LinkButton)e.Row.FindControl("LinkButton3"); LinkButton btn4 = (LinkButton)e.Row.FindControl("LinkButton4"); LinkButton btn5 = (LinkButton)e.Row.FindControl("LinkButton5"); btn1.Enabled = false; btn3.Enabled = false; } else { LinkButton btn1 = (LinkButton)e.Row.FindControl("LinkButton1"); LinkButton btn3 = (LinkButton)e.Row.FindControl("LinkButton3"); LinkButton btn4 = (LinkButton)e.Row.FindControl("LinkButton4"); LinkButton btn5 = (LinkButton)e.Row.FindControl("LinkButton5"); btn1.Enabled = true; btn3.Enabled = true; btn4.Enabled = true; btn5.Enabled = true; if (plat.IsDisabled) { btn1.Text = "<span class='fa fa-check-circle' title='启用'></span>"; } else { btn1.Text = "<span class='fa fa-ban' title='禁用'></span>"; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!B_ARoleAuth.Check(ZLEnum.Auth.shop, "OrderList")) { function.WriteErrMsg("没有权限进行此项操作"); } if (Mid < 1 && string.IsNullOrEmpty(OrderNO)) { function.WriteErrMsg("未指定订单"); } if (!IsPostBack) { if (Mid > 0) { orderinfo = oll.GetOrderListByid(Mid); } else if (!string.IsNullOrEmpty(Request["OrderNo"])) { orderinfo = oll.GetByOrder(Request["OrderNo"], "0"); } if (orderinfo == null || orderinfo.id < 1) { function.WriteErrMsg("订单不存在"); } OrderNO = orderinfo.OrderNo; //---------------------------------------------------------- M_UserInfo mu = buser.SelReturnModel(orderinfo.Userid); HeadTitle_L.Text = "订 单 信 息(订单编号:" + orderinfo.OrderNo + ")"; string giveurl = customPath2 + "User/Userexp.aspx?UserID=" + orderinfo.Userid + "&orderid=" + orderinfo.id; give_score_a.HRef = giveurl + "&type=" + (int)M_UserExpHis.SType.Point; give_purse_a.HRef = giveurl + "&type=" + (int)M_UserExpHis.SType.Purse; OrderNo_L.Text = orderinfo.OrderNo; Orderamounts_L.Text = orderinfo.Ordersamount.ToString("f2"); isCheckRe_L.Text = orderinfo.Guojia; Cdate_L.Text = orderinfo.AddTime.ToString("yyyy年MM月dd日 HH:mm"); Reuser.Text = StringHelper.SubStr(orderinfo.Reuser, 12); UName_L.Text = "<a href='javascript:;' onclick='showuinfo(" + mu.UserID + ");' title='查看用户'>" + mu.UserName + "</a>"; if (orderinfo.StateLogistics != 0) { Exp_Send_Btn.Enabled = false; } if (orderinfo.StateLogistics == 1) { Exp_ClientSign_Btn.Enabled = true; } if (orderinfo.StateLogistics == 0) { function.Script(this, "hiddLogistics();"); } if (orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { Paymentstatus.Text = "<span style='color:green';>已经汇款</span>"; Pay_Has_Btn.Disabled = true; } else { Paymentstatus.Text = "<span style='color:red;'>等待汇款</span>"; Pay_Has_Btn.Disabled = false; Exp_Send_Btn.Enabled = false; } switch ((M_OrderList.StatusEnum)orderinfo.OrderStatus) { case M_OrderList.StatusEnum.Normal: OS_Sure_Btn.Enabled = true; break; case M_OrderList.StatusEnum.DrawBack: OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; CheckReturn.Enabled = true; UnCheckRetrun.Enabled = true; Exp_Send_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; break; case M_OrderList.StatusEnum.UnDrawBack: case M_OrderList.StatusEnum.CheckDrawBack: OS_Invoice_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; Exp_Send_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; break; case M_OrderList.StatusEnum.OrderFinish: case M_OrderList.StatusEnum.UnitFinish: CompleteOrder_Btn.Enabled = false; break; default: break; } #region 物流信息 ExpStatus_L.Text = OrderHelper.GetExpStatus(orderinfo.StateLogistics); M_Order_Exp expMod = expBll.SelReturnModel(DataConverter.CLng(orderinfo.ExpressNum)); if (expMod != null) { ExpName_L.Text = expMod.ExpComp; ExpCode_L.Text = expMod.ExpNo; ExpStatus_L.Text += "(公司:" + expMod.ExpComp + "/单号:" + expMod.ExpNo + ")"; } switch ((M_OrderList.ExpEnum)orderinfo.StateLogistics) { case M_OrderList.ExpEnum.NoSend: Exp_Cancel_Btn.Enabled = false; ExpPrint_B.Disabled = true; break; case M_OrderList.ExpEnum.HasSend: Exp_ClientSign_Btn.Enabled = true; break; case M_OrderList.ExpEnum.HasReceived: Exp_Send_Btn.Enabled = false; break; } DrawBackStr.Text = orderinfo.Merchandiser; Deliverytime.Text = orderinfo.Deliverytime.ToString();//送货时间 switch (orderinfo.Deliverytime) { case 1: Deliverytime.Text = "对送货时间没有特殊要求"; break; case 2: Deliverytime.Text = "双休日或者周一至周五的晚上送达"; break; case 3: Deliverytime.Text = "周一至周五的白天送达"; break; default: break; } Phone.Text = orderinfo.Phone.ToString(); //联系电话 ZipCode.Text = orderinfo.ZipCode.ToString(); //邮政编码 Mobile.Text = orderinfo.MobileNum; //手机 Reusers.Text = orderinfo.Reuser.ToString(); //订货人 Jiedao.Text = orderinfo.Shengfen + " " + orderinfo.Jiedao; //地址 #endregion OrderStatus.Text = OrderHelper.GetOrderStatus(orderinfo.OrderStatus); adddate.Text = orderinfo.AddTime.ToShortDateString(); OrderType_L.Text = orderinfo.AddTime.ToString(); Invoiceneeds.Text = orderinfo.Invoiceneeds == 1 ? ComRE.Icon_OK : ComRE.Icon_Error; Developedvotes.Text = orderinfo.Developedvotes == 1 ? ComRE.Icon_OK : ComRE.Icon_Error; //如果已支付 if (orderinfo.Integral > 0 && orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { if (orderinfo.SendPointStatus == 1) { ISsend.Text = "已送出"; } } Pay_Has_Btn.Disabled = orderinfo.Paymentstatus == 1 ? true : false; //更改状态,已支付 OS_Freeze_Btn.Enabled = orderinfo.Settle == 1 ? false : true; //冻结 OS_Pause_Btn.Enabled = orderinfo.Suspended == 1 ? false : true; //暂停 if (orderinfo.Aside == 1) //已作废 { Pay_Has_Btn.Disabled = true; //ShowSend_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; CompleteOrder_Btn.Enabled = false; Exp_ClientSign_Btn.Enabled = false; OS_Freeze_Btn.Enabled = false; OS_Invoice_Btn.Enabled = false; OS_Pause_Btn.Enabled = false; OS_Aside_Btn.Enabled = false; Pay_Cancel_Btn.Enabled = false; Refund_B.Attributes["disabled"] = "disabled"; } else { OS_Aside_Btn.Enabled = true; } if (orderinfo.Settle == 1)//结清 { Pay_Has_Btn.Disabled = true; //ShowSend_Btn.Enabled = false; OS_Sure_Btn.Enabled = false; OS_NoSure_Btn.Enabled = false; OS_Aside_Btn.Enabled = false; Exp_ClientSign_Btn.Enabled = false; OS_Invoice_Btn.Enabled = false; OS_Pause_Btn.Enabled = false; } if (!string.IsNullOrEmpty(orderinfo.PaymentNo))//支付后才有值 { M_Payment payMod = payBll.SelModelByPayNo(orderinfo.PaymentNo); if (payMod.PayPlatID == 0) { Payment.Text = "虚拟币支付"; } else { M_PayPlat payPlatMod = platBll.GetPayPlatByid(payMod.PayPlatID); Payment.Text = payPlatMod.PayPlatName.ToString(); } } Email.Text = orderinfo.Email.ToString(); //电子信 Invoice.Text = orderinfo.Invoice.ToString(); //发票信息 if (orderinfo.Outstock == 1) { Outstock.Text = "缺货时,取消此订单"; } else { Outstock.Text = "缺货时,将有货的商品发出,取消无货商品的订购"; } AddUser.Text = orderinfo.AddUser.ToString(); //负责跟单人员 Internalrecords_T.Text = orderinfo.Internalrecords.ToString(); //内部记录 Ordermessage_T.Text = orderinfo.Ordermessage; //订货留言 LabScore.Text = orderinfo.Integral.ToString(); //积分 //-------购物车 DataTable cplist = cartProBll.GetCartProOrderID(Mid); Procart_RPT.DataSource = cplist; Procart_RPT.DataBind(); if (cplist.Rows.Count > 0 && !string.IsNullOrEmpty(cplist.Rows[0]["Additional"].ToString())) { M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(cplist.Rows[0]["Additional"].ToString()); List <M_Cart_Contract> modelList = new List <M_Cart_Contract>(); modelList.AddRange(model.Guest); modelList.AddRange(model.Contract); UserRPT.DataSource = modelList; UserRPT.DataBind(); } DataTable newtable = cplist.DefaultView.ToTable(false, "Shijia", "Pronum"); double allmoney = 0; for (int i = 0; i < newtable.Rows.Count; i++) { allmoney = allmoney + DataConverter.CDouble(cplist.Rows[i]["Allmoney"]); } //------- Label2.Text = orderinfo.Ordersamount.ToString(); Label29.Text = orderinfo.Ordersamount.ToString("f2"); Label31.Text = (orderinfo.Ordersamount).ToString("f2") + "元"; ReceMoney_L.Text = orderinfo.Receivablesamount.ToString("f2") + "元"; //判断订单所处状态 { if (orderinfo.OrderStatus < (int)M_OrderList.StatusEnum.Normal || orderinfo.Aside == 1) { prog_order_div.InnerHtml = OrderHelper.GetOrderStatus(orderinfo.OrderStatus, orderinfo.Aside, orderinfo.StateLogistics); } else { int current = 2; if (orderinfo.OrderStatus >= (int)M_OrderList.StatusEnum.OrderFinish) { current = 5; } else if (orderinfo.Paymentstatus >= (int)M_OrderList.PayEnum.HasPayed) { current++; switch (orderinfo.StateLogistics) { case (int)M_OrderList.ExpEnum.HasSend: current++; break; case (int)M_OrderList.ExpEnum.HasReceived: current += 2; break; } } function.Script(this, "$('#prog_order_div').ZLSteps('订单生成,等待用户支付,等待商户发货,等待用户签收,订单完结'," + current + ")"); } } Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='ProductManage.aspx'>商城管理</a></li><li><a href='OrderList.aspx'>订单管理</a></li><li class='active'><a href='" + Request.RawUrl + "'>订单详情</a></li>"); } }
/* * 仅支持支付单 */ protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); M_UserInfo mu = buser.GetLogin(false); if (string.IsNullOrEmpty(SiteConfig.SiteInfo.SiteUrl)) { function.WriteErrMsg("错误,管理员未定义网站地址,SiteUrl"); } string siteurl = (SiteConfig.SiteInfo.SiteUrl.TrimEnd('/') + "/PayOnline/"); if (string.IsNullOrEmpty(PayNo)) { function.WriteErrMsg("请传入支付单号"); } pinfo = paymentBll.SelModelByPayNo(PayNo); if (pinfo == null || pinfo.PaymentID < 1) { function.WriteErrMsg("支付单不存在"); } M_PayPlat payPlat = payPlatBll.GetPayPlatByid(pinfo.PayPlatID); if (!IsPostBack) { #region 母版页中信息 logged_div.Visible = true; #endregion if (pinfo.Status != (int)M_Payment.PayStatus.NoPay) { function.WriteErrMsg("支付单不能重复付款"); } Rurl_Href.NavigateUrl = "/User/Order/OrderList";//返回我的订单 if (pinfo.PaymentNum.Contains("IDC")) { Rurl_Href.NavigateUrl = "/Plugins/Domain/ViewHave.aspx"; } string url = Request.CurrentExecutionFilePath; urlReq1 = Request.Url.AbsoluteUri.ToString().Substring(0, Request.Url.AbsoluteUri.ToString().LastIndexOf('/')); double vmoney = pinfo.MoneyReal; //支付金额 string v_amount = pinfo.MoneyReal.ToString("f2"); //实际支付金额 if (string.IsNullOrEmpty(PayMethod)) { #region 现金支付 DataTable orderDB1 = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum);//订单表,ZL_OrderInfo int orderType = 0; if (orderDB1.Rows.Count > 0) { orderType = DataConvert.CLng(orderDB1.Rows[0]["OrderType"]); } if (orderType == 8)//有需要检测库存的订单类型,放此 { if (!cartBll.CheckStock(Convert.ToInt32(orderDB1.Rows[0]["OrderType"]))) { function.WriteErrMsg("商品库存数量不足,请重新购买"); } } DataTable ordertable = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum); int DeliveryID = 0; //送货方式ID if (ordertable != null && ordertable.Rows.Count > 0) { DeliveryID = DataConverter.CLng(ordertable.Rows[0]["Delivery"]); } if (pinfo.PayPlatID == 0 && !string.IsNullOrEmpty(pinfo.PlatformInfo))//支付宝网银支付 { payPlat = payPlatBll.GetPayPlatByClassID("15"); alipayBank(pinfo.PlatformInfo); } if (payPlat.PayClass == 99)//线下支付 { function.WriteSuccessMsg("信息已记录,请等待商家联系完成线下付款", Rurl_Href.NavigateUrl); } if (payPlat == null || payPlat.PayPlatID < 1) { function.WriteErrMsg("没有找到对应的支付平台信息!"); } //StringBuilder v_urlBuilder = new StringBuilder(); //构造返回URL //StringBuilder strHiddenField = new StringBuilder(); //string applicationName = paymentBll.GetApplicationName(); //if (!applicationName.EndsWith("/")) //{ // applicationName = applicationName + "/"; //} //v_urlBuilder.Append("http://"); //v_urlBuilder.Append(applicationName); //string v_ShowResultUrl = v_urlBuilder.ToString() + "PayOnline/ShowReturn.aspx?"; if (payPlat.PayClass == 100)//货到付款 { payinfo_div.Visible = false; AfterPay_Tb.Visible = true; Title = "下单成功!"; } else { payinfo_div.Visible = true; AfterPay_Tb.Visible = false; } switch ((M_PayPlat.Plat)payPlat.PayClass)//现仅开通 12:支付宝即时到账和支付宝网银服务,15支付宝网银服务(上方代码中处理),银币与余额服务 { #region 各种支付方式 case M_PayPlat.Plat.UnionPay: #region 银联在线 //gateway = "https://pay3.chinabank.com.cn/PayGate?encoding=UTF-8"; //必要的交易信息 string wv_amount = v_amount; // 订单金额 string wv_moneytype = "CNY"; // 币种 string wv_md5info; // 对拼凑串MD5私钥加密后的值 string wv_mid = payPlat.AccountID; // 商户号 //v_urlBuilder.Append("http://localhost:86/PayOnline/PayReceive.aspx?PayID=" +payid); string wv_url = urlReq1 + "/PayReceive.aspx?PayNo=" + PayNo; // 返回页地址 string wv_oid = pinfo.PayNo; // 推荐订单号构成格式为 年月日-商户号-小时分钟秒 //两个备注 // wv_mid = "1001"; 商户号,这里为测试商户号20000400,替换为自己的商户号即可 // wv_url = "http://localhost/chinabank/Receive.aspx"; 商户自定义返回接收支付结果的页面 // MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥 string wkey = payPlat.MD5Key; // 如果您还没有设置MD5密钥请登录我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/ // 登录后在上面的导航栏里可能找到“B2C”,在二级导航栏里有“MD5密钥设置” // 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了 wv_amount = v_amount; // 订单金额 wv_moneytype = "CNY"; // 币种 //对拼凑串MD5私钥加密后的值 wv_mid = payPlat.AccountID; // 商户号 wv_oid = pinfo.PayNo; // 推荐订单号构成格式为 年月日-商户号-小时分钟秒 if (wv_oid == null || wv_oid.Equals("")) { DateTime dt = DateTime.Now; string wv_ymd = dt.ToString("yyyyMMdd"); // yyyyMMdd string wtimeStr = dt.ToString("HHmmss"); // HHmmss wv_oid = wv_ymd + wv_mid + wtimeStr; } string text = wv_amount + wv_moneytype + wv_oid + wv_mid + wv_url + wkey; // 拼凑加密串 wv_md5info = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(text, "md5").ToUpper(); //strHiddenField.Append("<input type='hidden' name='v_md5info' value='" + wv_md5info + "'>\n"); //strHiddenField.Append("<input type='hidden' name='v_mid' value='" + wv_mid + "'>\n"); //strHiddenField.Append("<input type='hidden' name='v_oid' value='" + wv_oid + "'>\n"); //strHiddenField.Append("<input type='hidden' name='v_amount' value='" + wv_amount + "' >\n"); //strHiddenField.Append("<input type='hidden' name='v_moneytype' value='" + wv_moneytype + "'>\n"); //strHiddenField.Append("<input type='hidden' name='v_url' value='" + wv_url + "'>\n"); // //以下几项只是用来记录客户信息,可以不用,不影响支付 // strHiddenField.Append("<input type='hidden' name='v_rcvname' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_rcvaddr' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_rcvtel' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_rcvpost' value='" + "" + "' >\n"); // strHiddenField.Append("<input type='hidden' name='v_rcvemail' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_rcvmobile' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_ordername' value='" + "" + "' >\n"); // strHiddenField.Append("<input type='hidden' name='v_orderaddr' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_ordertel' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_orderpost' value='" + "" + "' >\n"); // strHiddenField.Append("<input type='hidden' name='v_orderemail' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='v_ordermobile' value='" + "" + "'>\n"); // strHiddenField.Append("<input type='hidden' name='Package' value='" + Request.QueryString["Package"] + "'>\n"); #endregion break; case M_PayPlat.Plat.Alipay_Instant: #region 支付宝[即时到帐] string input_charset1 = "utf-8"; string notify_url1 = urlReq1 + "/Return/AlipayNotify.aspx"; //付完款后服务器AJAX通知的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数 string return_url1 = urlReq1 + "/Return/AlipayReturn.aspx"; //付完款后跳转的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数 string show_url1 = ""; string sign_type1 = "MD5"; ///////////////////////以下参数是需要通过下单时的订单数据传入进来获得//////////////////////////////// //必填参数 string price1 = pinfo.MoneyReal.ToString("f2"); //订单总金额,显示在支付宝收银台里的“商品单价”里 string logistics_fee1 = "0.00"; //物流费用,即运费。 string logistics_type1 = "POST"; //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS) string logistics_payment1 = "SELLER_PAY"; //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费) string out_trade_no1 = pinfo.PayNo; //请与贵网站订单系统中的唯一订单号匹配 string subject1 = pinfo.Remark; //订单名称,显示在支付宝收银台里的“商品名称”里,显示在支付宝的交易管理的“商品名称”的列表里。 string body1 = pinfo.Remark; //订单描述、订单详细、订单备注,显示在支付宝收银台里的“商品描述”里 string quantity1 = "1"; //商品数量,建议默认为1,不改变值,把一次交易看成是一次下订单而非购买一件商品。 string receive_name1 = ""; //收货人姓名,如:张三 string receive_address1 = ""; //收货人地址,如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号 string receive_zip1 = ""; //收货人邮编,如:123456 string receive_phone1 = ""; //收货人电话号码,如:0571-81234567 string receive_mobile1 = ""; //收货人手机号码,如:13312341234 //--------------------- string receive_name = orderDB1.Rows[0]["Reuser"] + ""; //收货人姓名,如:张三 string receive_address = orderDB1.Rows[0]["Jiedao"] + ""; //收货人地址,如:XX省XXX市XXX区XXX路XXX小区XXX栋XXX单元XXX号 string receive_zip = orderDB1.Rows[0]["ZipCode"] + ""; //收货人邮编,如:123456 string receive_phone = orderDB1.Rows[0]["Phone"] + ""; //收货人电话号码,如:0571-81234567 string receive_mobile = orderDB1.Rows[0]["MobileNum"] + ""; //收货人手机号码,如:13312341234 //扩展参数——第二组物流方式 //物流方式是三个为一组成组出现。若要使用,三个参数都需要填上数据;若不使用,三个参数都需要为空 //有了第一组物流方式,才能有第二组物流方式,且不能与第一个物流方式中的物流类型相同, //即logistics_type="EXPRESS",那么logistics_type_1就必须在剩下的两个值(POST、EMS)中选择 string logistics_fee_3 = ""; //物流费用,即运费。 string logistics_type_3 = ""; //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS) string logistics_payment_3 = ""; //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费) //扩展参数——第三组物流方式 //物流方式是三个为一组成组出现。若要使用,三个参数都需要填上数据;若不使用,三个参数都需要为空 //有了第一组物流方式和第二组物流方式,才能有第三组物流方式,且不能与第一组物流方式和第二组物流方式中的物流类型相同, //即logistics_type="EXPRESS"、logistics_type_1="EMS",那么logistics_type_2就只能选择"POST" string logistics_fee_4 = ""; //物流费用,即运费。 string logistics_type_4 = ""; //物流类型,三个值可选:EXPRESS(快递)、POST(平邮)、EMS(EMS) string logistics_payment_4 = ""; //物流支付方式,两个值可选:SELLER_PAY(卖家承担运费)、BUYER_PAY(买家承担运费) //扩展功能参数——其他 string buyer_email1 = ""; //默认买家支付宝账号 string discount1 = ""; //折扣,是具体的金额,而不是百分比。若要使用打折,请使用负数,并保证小数点最多两位数 ///////////////////////////////////////////////////////////////////////////////////////////////////// //构造请求函数,无需修改 B_AliPay_trades_Services aliService1 = new B_AliPay_trades_Services( payPlat.AccountID, payPlat.SellerEmail, return_url1, notify_url1, show_url1, out_trade_no1, subject1, body1, price1, logistics_fee1, logistics_type1, logistics_payment1, quantity1, receive_name1, receive_address1, receive_zip1, receive_phone1, receive_mobile1, logistics_fee_3, logistics_type_3, logistics_payment_3, logistics_fee_4, logistics_type_4, logistics_payment_4, buyer_email1, discount1, payPlat.MD5Key, input_charset1, sign_type1); Alipay_Btn.Visible = true; LblHiddenValue.InnerHtml = aliService1.Build_Form(); #endregion break; case M_PayPlat.Plat.Alipay_Bank: //支付宝网银,已上方处理 break; case M_PayPlat.Plat.Mobo: #region 成都MO宝支付 { string pfxFilePath = Server.MapPath("/muzi.pfx"); string cerFilePath = Server.MapPath("/mobaopay.cer"); string passwd = payPlat.MD5Key; if (!File.Exists(pfxFilePath) || !File.Exists(cerFilePath)) { function.WriteErrMsg("证书文件不存在"); } Mobo360SignUtil.Instance.init(pfxFilePath, cerFilePath, passwd); //-------------------------------------------------------------------- Dictionary <string, string> payData = new Dictionary <string, string>(); payData.Add("apiName", "WEB_PAY_B2C"); payData.Add("apiVersion", "1.0.0.0"); payData.Add("platformID", payPlat.PayPlatinfo); //平台ID,商户号 payData.Add("merchNo", payPlat.AccountID); payData.Add("orderNo", pinfo.PayNo); //订单号, payData.Add("tradeDate", DateTime.Now.ToString("yyyyMMdd")); payData.Add("amt", pinfo.MoneyReal.ToString("f2")); payData.Add("merchUrl", urlReq1 + "/Return/MoBaoReturn.aspx"); payData.Add("merchParam", ""); payData.Add("tradeSummary", pinfo.Remark); payData.Add("signMsg", Mobo360SignUtil.Instance.sign(payData)); string payReqUrl = Mobo360Merchant.Instance.generatePayUrl(payData, "https://trade.mobaopay.com/cgi-bin/netpayment/pay_gate.cgi"); Response.ContentEncoding = System.Text.Encoding.UTF8; Alipay_Btn.Visible = true; LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm(payReqUrl, null); //Response.Redirect(payReqUrl);// 重定向客户端到收银台 //Confirm_VMoney_Btn.Visible = true; } #endregion break; case M_PayPlat.Plat.WXPay: #region 微信扫码支付 { pinfo.PlatformInfo = "0"; paymentBll.Update(pinfo); WxPayData wxdata = new WxPayData(); wxdata.SetValue("out_trade_no", pinfo.PayNo); wxdata.SetValue("body", string.IsNullOrEmpty(pinfo.Remark) ? "微信支付" : pinfo.Remark); wxdata.SetValue("total_fee", Convert.ToInt32(pinfo.MoneyReal * 100)); wxdata.SetValue("trade_type", "NATIVE"); wxdata.SetValue("notify_url", urlReq1 + "/Return/WxPayReturn.aspx"); wxdata.SetValue("product_id", "1"); WxPayData result = WxPayApi.UnifiedOrder(wxdata, WxPayApi.Pay_GetByID()); if (result.GetValue("return_code").ToString().Equals("FAIL")) { function.WriteErrMsg("商户" + result.GetValue("return_msg")); } Response.Redirect("/PayOnline/WxCodePay.aspx?PayNo=" + pinfo.PayNo + "&wxcode=" + result.GetValue("code_url")); } #endregion break; case M_PayPlat.Plat.BaoFo: #region 宝付 { Pay_BaoFa baofaBll = new Pay_BaoFa(); //测试使用 payPlat.AccountID = "100000178"; payPlat.MD5Key = "abcdefg"; payPlat.PayPlatinfo = "10000001"; Dictionary <string, string> dics = new Dictionary <string, string>(); dics.Add("MemberID", payPlat.AccountID); //"100000178", dics.Add("PayID", ""); dics.Add("TradeDate", DateTime.Now.ToString("yyyyMMddHHmmss")); dics.Add("TerminalID", payPlat.PayPlatinfo); //19534 dics.Add("InterfaceVersion", "4.0"); dics.Add("KeyType", "1"); dics.Add("TransID", pinfo.PayNo); dics.Add("OrderMoney", (pinfo.MoneyReal * 100).ToString("f0")); //金额必须相等,否则会报签名失败 dics.Add("ProductName", pinfo.Remark); dics.Add("Amount", pinfo.MoneyReal.ToString("f2")); dics.Add("Username", mu.UserName); dics.Add("AdditionalInfo", ""); //可填sessionid等 dics.Add("PageUrl", siteurl + "/Return/BaoFaoShow.aspx"); dics.Add("ReturnUrl", siteurl + "/Return/BaoFaoNotify.aspx"); //是否必须正式才会有回调 dics.Add("NoticeType", "1"); string signature = baofaBll.GetMd5Sign(dics["MemberID"], dics["PayID"], dics["TradeDate"] , dics["TransID"], dics["OrderMoney"] , dics["PageUrl"], dics["ReturnUrl"], dics["NoticeType"], payPlat.MD5Key); dics.Add("Signature", signature); Alipay_Btn.Visible = true; //测试URL:http://tgw.bfopay.com/payindex //正式:http://gw.bfopay.com/payindex LblHiddenValue.InnerHtml = baofaBll.BuildForm("http://tgw.bfopay.com/payindex", dics); } #endregion break; case M_PayPlat.Plat.EPay95: #region 双乾 { Dictionary <string, string> epay_dics = new Dictionary <string, string>(); epay_dics.Add("MerNo", payPlat.AccountID); epay_dics.Add("BillNo", pinfo.PayNo); epay_dics.Add("Amount", pinfo.MoneyReal.ToString("f2")); epay_dics.Add("ReturnURL", siteurl + "Return/EPay95Result.aspx"); epay_dics.Add("NotifyURL", siteurl + "Return/EPay95Notify.aspx"); string EpayMD5Key = payPlat.MD5Key; string md5md5 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(EpayMD5Key, "MD5").ToUpper(); //注意这里和示例不同,其示例是错误的. string md5src = StringHelper.MD5("Amount=" + pinfo.MoneyReal.ToString("f2") + "&BillNo=" + pinfo.PayNo + "&MerNo=" + payPlat.AccountID + "&ReturnURL=" + siteurl + "EPay95Result.aspx" + "&" + md5md5).ToUpper(); epay_dics.Add("MD5info", md5src); epay_dics.Add("PayType", "CSPAY"); epay_dics.Add("MerRemark", "双乾支付"); epay_dics.Add("products", pinfo.Remark); LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm("https://www.95epay.cn/sslpayment", epay_dics); Alipay_Btn.Visible = true; } #endregion break; case M_PayPlat.Plat.Ebatong: #region Ebatong { Dictionary <string, string> ebatong_dics = new Dictionary <string, string>(); ebatong_dics.Add("sign_type", "MD5"); ebatong_dics.Add("service", "create_direct_pay_by_user"); ebatong_dics.Add("partner", payPlat.AccountID); ebatong_dics.Add("input_charset", "UTF-8"); ebatong_dics.Add("notify_url", siteurl + "Return/EbatongNotify.aspx"); //服务器异步通知页面路径 ebatong_dics.Add("return_url", siteurl + "Return/EbatongReturn.aspx"); //服务器跳转页面 ebatong_dics.Add("out_trade_no", pinfo.PayNo); ebatong_dics.Add("subject", pinfo.Remark); ebatong_dics.Add("exter_invoke_ip", Request.UserHostAddress); ebatong_dics.Add("payment_type", "1"); ebatong_dics.Add("seller_id", payPlat.AccountID); ebatong_dics.Add("total_fee", pinfo.MoneyReal.ToString("f2")); ebatong_dics.Add("error_notify_url", ""); ebatong_dics.Add("anti_phishing_key", new ZoomLa.BLL.Ebatong.AskForTimestamp().askFor(payPlat.AccountID, payPlat.MD5Key)); ebatong_dics.Add("seller_email", ""); ebatong_dics.Add("buyer_email", ""); ebatong_dics.Add("buyer_id", ""); ebatong_dics.Add("price", ""); ebatong_dics.Add("quantity", ""); ebatong_dics.Add("body", ""); ebatong_dics.Add("show_url", ""); ebatong_dics.Add("pay_method", "bankPay"); ebatong_dics.Add("extra_common_para", ""); ebatong_dics.Add("extend_param", ""); ebatong_dics.Add("it_b_pay", ""); ebatong_dics.Add("royalty_type", ""); ebatong_dics.Add("royalty_parameters", ""); ebatong_dics.Add("default_bank", ""); string[] paramts = new string[ebatong_dics.Keys.Count]; //参数排序数组 ebatong_dics.Keys.CopyTo(paramts, 0); Array.Sort(paramts); //参数排序操作 string paramstr = ""; foreach (string item in paramts) { paramstr += string.Format("{0}={1}&", item, ebatong_dics[item]); } //throw new Exception(paramstr.Trim('&')); string md5md5 = new ZoomLa.BLL.Ebatong.CommonHelper().md5("UTF-8", paramstr.Trim('&') + payPlat.MD5Key).ToLower(); ebatong_dics.Add("sign", md5md5); LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm("https://www.ebatong.com/direct/gateway.htm", ebatong_dics); Alipay_Btn.Visible = true; } #endregion break; case M_PayPlat.Plat.CCB: #region 江西建行 { Dictionary <string, string> ccb_dics = new Dictionary <string, string>(); ccb_dics.Add("MERCHANTID", payPlat.AccountID); //商户代码 ccb_dics.Add("POSID", payPlat.PrivateKey); //柜台代码 ccb_dics.Add("BRANCHID", payPlat.PublicKey); //分行代码 ccb_dics.Add("ORDERID", pinfo.PayNo); ccb_dics.Add("PAYMENT", pinfo.MoneyReal.ToString("f2")); ccb_dics.Add("CURCODE", "01"); ccb_dics.Add("REMARK1", ""); //备注信息1(具体信息待测试) ccb_dics.Add("REMARK2", ""); //备注信息2 ccb_dics.Add("TXCODE", "520100"); string ccb_paramstr = ""; foreach (String item in ccb_dics.Keys) { ccb_paramstr += string.Format("{0}={1}&", item, ccb_dics[item]); } string md5str = new ZoomLa.BLL.Ebatong.CommonHelper().md5("UTF-8", ccb_paramstr.Trim('&')).ToLower(); ccb_dics.Add("MAC", md5str); LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm("https://ibsbjstar.ccb.com.cn/app/ccbMain", ccb_dics); Alipay_Btn.Visible = true; //Response.Redirect("https://ibsbjstar.ccb.com.cn/app/ccbMain?" + ccb_paramstr + "MAC=" + md5str); } #endregion break; case M_PayPlat.Plat.ECPSS: #region 汇潮支付 { Dictionary <string, string> payData = new Dictionary <string, string>(); payData.Add("OrderDesc", "test"); //订单描述 payData.Add("Remark", "汇潮支付"); //备注 payData.Add("AdviceURL", siteurl + "Return/ECPSSNotfy.aspx"); //回调通知地址 payData.Add("ReturnURL", siteurl + "Return/ECPSSResult.aspx"); //返回地址 payData.Add("BillNo", pinfo.PayNo); //订单号 payData.Add("MerNo", payPlat.AccountID); //商户号 payData.Add("Amount", pinfo.MoneyReal.ToString("f2")); //交易价格 string md5key = payPlat.MD5Key; string md5str = payData["MerNo"] + "&" + payData["BillNo"] + "&" + payData["Amount"] + "&" + payData["ReturnURL"] + "&" + md5key; payData.Add("SignInfo", System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(md5str, "MD5")); //签名 payData.Add("defaultBankNumber", ""); //银行代码(选填) payData.Add("orderTime", DateTime.Now.ToString("yyyyMMddHHmmss")); //交易时间yyyyMMddHHmmss payData.Add("products", pinfo.Remark); //物品信息 LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm("https://pay.ecpss.com/sslpayment", payData); Alipay_Btn.Visible = true; } #endregion break; case M_PayPlat.Plat.ICBC_NC: #region 南昌工行 { function.WriteErrMsg("工行支付组件未注册,请联系管理员"); //ICBCHelper icbc = new ICBCHelper(); //infosecapiLib.infosecClass obj = new infosecapiLib.infosecClass(); //Dictionary<string, string> dics = new Dictionary<string, string>(); //string posturl = "https://B2C.icbc.com.cn/servlet/ICBCINBSEBusinessServlet"; //---Debug //payPlat.AccountID = "1502EC24392836"; //payPlat.SellerEmail = "1502201009004747554"; //payPlat.PrivateKey = "/Cert/cs.key"; //payPlat.PublicKey = "/Cert/cs.cer"; //posturl = "https://myipad.dccnet.com.cn/servlet/NewB2cMerPayReqServlet"; //throw new Exception(payPlat.PrivateKey + ":" + payPlat.PublicKey + ":" + payPlat.AccountID + ":" + payPlat.SellerEmail); //Debug End //*.z01.com根据需要更改如*.hx008.com //string data = icbc.SpliceTranData(pinfo, payPlat.AccountID.Trim(), payPlat.SellerEmail.Trim(), "*.z01.com", siteurl + "ICBCNotify.aspx"); //string sign = obj.sign(data, Server.MapPath(payPlat.PrivateKey), payPlat.MD5Key.Trim());//私钥虚拟路径与私钥密钥 //dics.Add("interfaceName", "ICBC_PERBANK_B2C"); //dics.Add("interfaceVersion", "1.0.0.11"); //dics.Add("tranData", obj.base64enc(data)); //dics.Add("merSignMsg", sign); //dics.Add("merCert", icbc.ReadCertToBase64(payPlat.PublicKey));//公钥路径 //LblHiddenValue.InnerHtml = new Pay_BaoFa().BuildForm(posturl, dics); //Alipay_Btn.Visible = true; } #endregion break; case M_PayPlat.Plat.CashOnDelivery: #region 货到付款 zfpt.Text = payPlat.PayPlatName; ddh.Text = pinfo.PaymentNum; PayNum_L2.Text = Convert.ToDecimal(vmoney).ToString("F2") + " 元"; sxf.Text = payPlat.Rate.ToString() + " %"; sjhbje.Text = v_amount + " 元"; #endregion break; default: throw new Exception("错误:支付方式不存在"); #endregion } VMoneyPayed_L.Text = payPlat.PayPlatName; OrderNo_L.Text = pinfo.PaymentNum; LblRate.Text = payPlat.Rate.ToString() + " %"; #endregion } else//非现金支付,给用户显示确认支付页,实际支付行为在Confirm_Click { Confirm_VMoney_Btn.Visible = true; payinfo_div.Visible = true; AfterPay_Tb.Visible = false; OrderNo_L.Text = pinfo.PaymentNum; DataTable ordertable = orderBll.GetOrderbyOrderNo(pinfo.PaymentNum); if (ordertable != null && ordertable.Rows.Count > 0) { switch (PayMethod) { case "Purse": //Titles.Text = "余额支付操作(确认支付款项)"; Fee.Text = "帐户余额:"; LblRate.Text = mu.Purse + " 元"; VMoneyPayed_L.Text = "帐户余额"; break; case "SilverCoin": //Titles.Text = "银币支付操作(确认支付款项)"; Fee.Text = "帐户银币:"; LblRate.Text = mu.SilverCoin + " 个"; VMoneyPayed_L.Text = "账户银币"; break; case "Score": //Titles.Text = "积分支付操作(确认支付款项)"; Fee.Text = "帐户积分:"; LblRate.Text = mu.UserExp + " 分"; VMoneyPayed_L.Text = "账户积分"; break; default: break; } } else { payinfo_div.Visible = false; AfterPay_Tb.Visible = false; function.WriteErrMsg("订单不存在"); } } //显示金额信息 LblPayMoney.Text = pinfo.MoneyReal.ToString("F2") + " 元";//应付金额 //string priceJson = orderCom.GetTotalJson(ordertable);//多虚拟币支付,暂取消 //M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(priceJson); //if (orderCom.HasPrice(priceJson)) //{ // if (priceMod.Purse > 0) // { // LblPayMoney.Text += " 余额:" + priceMod.Purse.ToString("f2"); // } // if (priceMod.Sicon > 0) // { LblPayMoney.Text += " 银币:" + priceMod.Sicon.ToString("f2"); } // if (priceMod.Point > 0) // { // LblPayMoney.Text += " 积分:" + priceMod.Point.ToString("f2"); // } //} } //------------------检测End; }