protected void Page_Load(object sender, EventArgs e) { string code = Request["code"]; //支付接口编号 string type = Request["type"]; //支付类型, OD为订单 string num = Request["num"]; //相应的单号 string md5sign = Request["key"]; //MD5 Sign string payno = num; //检查数据传递完整 if (!PayHepler.dataCheck(num + type + code, md5sign)) { Response.Redirect("~/default.aspx"); Response.End(); } PayEntity entity = new PayEntity(code); //生成一个接口类型 PayType paytype = PayTypeFac.getPayType(type, num, payno); //生成一个支付类型 string status = Request["payment_status"]; if (status == "Completed" || status == "Pending") { paytype.success(); Common.WriteToFile.WriteToTxt("PayPal支付异常----支付单号:" + Request["txn_id"] + "----" + Request["business"] + "----" + DateTime.Now.ToString(), "pay/PayPal/Log/"); //Response.Redirect("../payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=success"); } else { paytype.failed(); Common.WriteToFile.WriteToTxt("PayPal支付异常----支付单号:" + Request["txn_id"] + "----" + Request["business"] + "----" + DateTime.Now.ToString(), "pay/PayPal/Log/"); //Response.Redirect("../payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=failed"); } }
protected void Page_Load(object sender, EventArgs e) { //支付成功前,统一跳转到此页面 code = Request.QueryString["code"]; //支付接口编号 type = Request.QueryString["type"]; //支付类型, OD为订单 num = Request.QueryString["num"]; //相应的单号 BLL.Pay.PayEntity entity = new BLL.Pay.PayEntity(code); //在线支付的,跳转到指定支付页 if (code == "01") { if (!string.IsNullOrEmpty(entity.sendURL)) { string key = BLL.Pay.PayHepler.dataEncrypt(num + type + code); string url = entity.sendURL + "?code=" + code + "&num=" + num + "&type=" + type + "&key=" + key; Response.Redirect(entity.sendURL + "?code=" + code + "&num=" + num + "&type=" + type + "&key=" + key); Response.End(); } else { //非在线支付的,直接输出内容 Response.Write(entity.content); Response.End(); } } else if (code == "02") { PayType paytype = PayTypeFac.getPayType(type, num);//生成一个支付类型 payaccount = entity.payAccount; amount = paytype.amount * 100; } }
protected void Page_Load(object sender, EventArgs e) { string code = Request.QueryString["code"]; //支付接口编号 string type = Request.QueryString["type"]; //支付类型, OD为订单 string num = Request.QueryString["num"]; //相应的单号 string md5sign = Request.QueryString["key"]; //MD5 Sign string webSite = "http://" + Request.Url.Host; //检查数据传递完整 if (!PayHepler.dataCheck(num + type + code, md5sign)) { Response.Redirect("~/default.aspx"); Response.End(); } PayEntity entity = new PayEntity(code); //生成一个接口类型 PayType paytype = PayTypeFac.getPayType(type, num); //生成一个支付类型 business = entity.payAccount; item_name = paytype.num; item_number = paytype.num; a3 = paytype.amount.ToString("f2"); notify_url = webSite + "/" + entity.notifyURL + "?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num; returnUrl = webSite + "/" + entity.returnURL + "?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num; cancel_return = webSite + "/pay/payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=failed"; }
protected void Page_Load(object sender, EventArgs e) { string code = Request["code"]; //支付接口编号 string type = Request["type"]; //支付类型, OD为订单 string num = Request["num"]; //相应的单号 string md5sign = Request["key"]; //MD5 Sign //检查数据传递完整 if (!PayHepler.dataCheck(num + type + code, md5sign)) { Response.Redirect("~/default.aspx"); Response.End(); } PayEntity entity = new PayEntity(code); //生成一个接口类型 PayType paytype = PayTypeFac.getPayType(type, num); //生成一个支付类型 string status = Request["payment_status"]; Response.Write(status); if (!string.IsNullOrEmpty(status)) { if (status == "Completed" || status == "Pending") { try { paytype.payNo = Request["txn_id"]; paytype.Sj = Request["business"]; paytype.Mj = Request["payer_email"]; paytype.payCode = code; paytype.success(); Response.Redirect("../payend.aspx?code=" + code + "&type=" + type + "&key=" + md5sign + "&num=" + num + "&status=success"); } catch (Exception ex) { Common.WriteToFile.WriteToTxt("PayPal支付异常----支付单号:" + paytype.num + "----" + ex.Message + "----" + DateTime.Now.ToString(), "pay/PayPal/Log/"); } } else { paytype.failed(); } } }
protected void Page_Load(object sender, EventArgs e) { string type = "OD"; //支付类型, OD为订单 string num = Request.QueryString["num"]; //相应的单号 string md5sign = Request.QueryString["key"].ToUpper(); //MD5 Sign string traceno = Request.QueryString["traceno"]; //检查数据传递完整 if (!PayHepler.dataCheck(num, md5sign)) { Response.Redirect("~/default.aspx"); Response.End(); } else { PayType paytype = PayTypeFac.getPayType(type, num);//生成一个支付类型 paytype.payCode = "02"; paytype.payNo = traceno; paytype.success(); Response.Redirect("../payend.aspx?code=02&type=" + type + "&num=" + num + "&status=success"); } }
protected void Page_Load(object sender, EventArgs e) { string num = Com.Util.getStringByObject(Request["num"]).ToString(); //相应的单号 string md5sign = Com.Util.getStringByObject(Request["key"]).ToString().ToUpper(); //MD5 Sign string traceno = Com.Util.getStringByObject(Request["traceno"]).ToString(); //Common.Log.WriteLog("Tips====","Back=====","后台处理"); //Common.Log.WriteLog("Tips====", "Back=====", num); //Common.Log.WriteLog("Tips====", "Back=====", md5sign); //Common.Log.WriteLog("Tips====", "Back=====", traceno); //检查数据传递完整 if (!PayHepler.dataCheck(num, md5sign)) { Response.End(); } else { string type = "OD"; PayType paytype = PayTypeFac.getPayType(type, num);//生成一个支付类型 paytype.payCode = "02"; paytype.payNo = traceno; paytype.success(); } }