/// <summary> /// Default sort by work_day,part_no,prom_date,ordid,dop,dop_lin all not null /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo([AllowNull] Acc_material_ord other) { if (other == null) { return(1); } else { int result = Work_day.Date.CompareTo(other.Date_entered.Date); if (result == 0) { result = Part_no.CompareTo(other.Part_no); if (result == 0) { result = Prom_date.Date.CompareTo(other.Prom_date.Date); if (result == 0) { result = OrdId.CompareTo(other.OrdId); if (result == 0) { result = Dop.CompareTo(other.Dop); if (result == 0) { result = Dop_lin.CompareTo(other.Dop_lin); } } } } } return(result); } }
protected void Page_Load(object sender, EventArgs e) { string CmdId, MerId, RespCode, TrxId, OrdAmt, CurCode, Pid, OrdId, MerPriv, RetType, DivDetails, GateId, ChkValue; CmdId = RequestString("CmdId"); //消息类型 MerId = RequestString("MerId"); //商户号 RespCode = RequestString("RespCode"); //应答返回码 TrxId = RequestString("TrxId"); //钱管家交易唯一标识 OrdAmt = RequestString("OrdAmt"); //金额 CurCode = RequestString("CurCode"); //币种 Pid = RequestString("Pid"); //商品编号 OrdId = RequestString("OrdId"); //订单号 MerPriv = RequestString("MerPriv"); //商户私有域 RetType = RequestString("RetType"); //返回类型 DivDetails = RequestString("DivDetails"); //分账明细 GateId = RequestString("GateId"); //银行ID ChkValue = RequestString("ChkValue"); //签名信息 Lebi_Order order; if (OrdId.Contains("lebiorderid_")) { //OrdId = OrdId.Replace("lebiorderid_", ""); order = B_Lebi_Order.GetModel("id=lbsql{'" + OrdId.Replace("lebiorderid_", "") + "'}"); } else { order = B_Lebi_Order.GetModel("Code=lbsql{'" + OrdId + "'}"); } if (order == null) { Response.Write("系统错误"); Response.End(); return; } Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order, "chinapnr"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } //验证签名 string MsgData, SignData; MsgData = CmdId + MerId + RespCode + TrxId + OrdAmt + CurCode + Pid + OrdId + MerPriv + RetType + DivDetails + GateId; //参数顺序不能错 CHINAPNRLib.NetpayClient SignObject = new NetpayClientClass(); string keypath = System.Web.HttpContext.Current.Server.MapPath("~/" + pay.UserKey.TrimStart('/')); SignData = SignObject.VeriSignMsg0(keypath, MsgData, MsgData.Length, ChkValue); //请将此处改成你的私钥文件所在路径 if (SignData == "0") { if (RespCode == "000000") { //交易成功 //根据订单号 进行相应业务操作 //在些插入代码 Order.OnlinePaySuccess("chinapnr", order.Code); } else { //交易失败 //根据订单号 进行相应业务操作 //在些插入代码 } Response.Write("RECV_ORD_ID_" + OrdId); } else { //验签失败 } }
/// <summary> /// IsValidation /// </summary> private void IsValidation() { try { //GateId =U2 //MerPriv = //TrxId =2013062589057816 //OrdId =30201020130625000010 //RetType =2 //OrdAmt =1.00 //Pid = //ChkValue =9188B176EE0CEC769E077BC63ACE7ADBDAD0FA273A5C81DF9E14C67789F93FACFBF062F22A9EECCA4208CBCEDC4084505C4565E32BA20C9670FC83C775804520AC8C317A2B59BF1FE173F7AC58A80286A54DBA3A2B6C8CFC8559A8530D6E2A55CDF1286A6EE1169712C90212526EA8A0E954B0D3488A8BEEC025DB4AA702F6BD //CmdId =Buy //DivDetails =Agent:00000458605930201020:1.00 //CurCode =RMB //RespCode =000000 //MerId =871997 String GateId, MerPriv, TrxId, OrdId, RetType, OrdAmt, Pid, ChkValue, CmdId, DivDetails, CurCode, RespCode, MerId; GateId = Request.Form["GateId"]; MerPriv = Request.Form["MerPriv"]; TrxId = Request.Form["TrxId"]; OrdId = Request.Form["OrdId"]; RetType = Request.Form["RetType"]; OrdAmt = Request.Form["OrdAmt"]; Pid = Request.Form["Pid"]; ChkValue = Request.Form["ChkValue"]; CmdId = Request.Form["CmdId"]; DivDetails = Request.Form["DivDetails"]; CurCode = Request.Form["CurCode"]; RespCode = Request.Form["RespCode"]; MerId = Request.Form["MerId"]; string SignData = ""; #region 验证签名使用 PbProject.Logic.Pay.ChinaPnr _ChinaPnr = new PbProject.Logic.Pay.ChinaPnr(); String MsgData; MsgData = CmdId + MerId + RespCode + TrxId + OrdAmt + CurCode + Pid + OrdId + MerPriv + RetType + DivDetails + GateId; //参数顺序不能错 CHINAPNRLib.NetpayClient SignObject = new CHINAPNRLib.NetpayClientClass(); SignData = SignObject.VeriSignMsg0(_ChinaPnr._PgKeyUrl, MsgData, MsgData.Length, ChkValue); //请将此处改成你的私钥文件所在路径 #endregion if (SignData == "0") { if (RespCode == "000000") { #region 交易成功 if (CmdId == "Buy") { new PbProject.Logic.Pay.Bill().CreateLogMoneyDetail("", TrxId, OrdAmt, 12, OrdId.Substring(0, 8), "POS充值", "POS充值"); } #endregion } else { //交易失败 OnErrorNew("交易失败 OrdId=" + OrdId, false); } Response.Write("RECV_ORD_ID_" + OrdId); } else { //验签失败 OnErrorNew("验签失败", false); } } catch (Exception ex) { } }
/// <summary> /// Equatable by Work_day,Part_no,OrdId,Dop,Dop_lin /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals([AllowNull] Acc_material_ord other) { if (other == null) { return(false); } return(Work_day.Date.Equals(other.Work_day.Date) && Part_no.Equals(other.Part_no) && OrdId.Equals(other.OrdId) && Dop.Equals(other.Dop) && Dop_lin.Equals(other.Dop_lin)); }
/// <summary> /// IsValidation /// </summary> private void IsValidation() { try { String CmdId, MerId, RespCode, TrxId, OrdAmt, CurCode, Pid, OrdId, MerPriv, RetType, DivDetails, GateId, ChkValue; String MsgData = "", SignData = ""; CmdId = Request.Form["CmdId"]; //消息类型 MerId = Request.Form["MerId"]; //商户号 RespCode = Request.Form["RespCode"]; //应答返回码 TrxId = Request.Form["TrxId"]; //钱管家交易唯一标识 OrdAmt = Request.Form["OrdAmt"]; //金额 CurCode = Request.Form["CurCode"]; //币种 Pid = Request.Form["Pid"]; //商品编号 OrdId = Request.Form["OrdId"]; //订单号 MerPriv = Request.Form["MerPriv"]; //商户私有域 RetType = Request.Form["RetType"]; //返回类型 DivDetails = Request.Form["DivDetails"]; //分账明细 GateId = Request.Form["GateId"]; //银行ID ChkValue = Request.Form["ChkValue"]; //签名信息 PbProject.Logic.Pay.ChinaPnr _ChinaPnr = new PbProject.Logic.Pay.ChinaPnr(); #region 旧方法 /* * * String MsgData, SignData; * MsgData = CmdId + MerId + RespCode + TrxId + OrdAmt + CurCode + Pid + OrdId + MerPriv + RetType + DivDetails + GateId; //参数顺序不能错 * CHINAPNRLib.NetpayClient SignObject = new CHINAPNRLib.NetpayClientClass(); * SignData = SignObject.VeriSignMsg0(_ChinaPnr._PgKeyUrl, MsgData, MsgData.Length, ChkValue); //请将此处改成你的私钥文件所在路径 * */ #endregion if (SignData == "0") { if (RespCode == "000000") { #region 交易成功 if (CmdId == "Buy") { //支付 if (OrdId.Substring(0, 1) == "0") { } } #endregion } else { //交易失败 OnErrorNew("交易失败", false); } Response.Write("RECV_ORD_ID_" + OrdId); } else { //验签失败 OnErrorNew("验签失败", false); } } catch (Exception ex) { } }