protected void btnNext_Click(object sender, EventArgs e) { Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); long cardno = Convert.ToInt64(txtToptocard.Value.Trim()); string cardpwd = txtTopfoPwd.Value.Trim(); string remark = "充值卡充值"; int i = dal.CardStrike(txtLoginName1.Value.Trim(), cardno, cardpwd, loginname, remark); if (i == 0) { Tz888.Common.MessageBox.Show(this.Page, "充值成功"); Response.Redirect("strike_records.aspx"); } else if (i == 1) { Tz888.Common.MessageBox.Show(this.Page, "卡号或密码错误!"); } else if (i == 2) { Tz888.Common.MessageBox.Show(this.Page, "此卡已经被充值!"); } else { Tz888.Common.MessageBox.Show(this.Page, "充值失败!请重试!"); } }
protected void btnEnter_Click(object sender, EventArgs e) { if (!Tz888.Common.Utility.PageValidate.IsEmail(txtEmail.Value.Trim())) { Tz888.Common.MessageBox.Show(this.Page, "请输入正确的邮件地址"); return; } Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "bank"; model.LoginName = Page.User.Identity.Name; //充值人 model.StrikeLoginName = lblLoginName.Text; //充值帐户 model.Email = txtEmail.Value.Trim(); model.Tel = txtTel.Value.Trim(); model.RealName = txtName.Value.Trim(); model.MobileNo = txtMobile.Value.Trim(); model.TotalCount = Convert.ToDouble(txtMoney.Value); int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { Response.Redirect("strike_wait.aspx"); } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } }
protected void btnEnter_Click(object sender, EventArgs e) { Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "pnr"; model.LoginName = Page.User.Identity.Name; //充值人 model.StrikeLoginName = lblLoginName.Text; //充值帐户 model.TotalCount = Convert.ToDouble(txtMoney.Value); int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { string postForm = OnlineStrike.pnrForm(orderno.ToString(), lblMoney.Text.Trim()); Response.Write(postForm); } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Request.ContentEncoding = System.Text.Encoding.GetEncoding(QuickPayConf.charset); String[] resArr = new String[QuickPayConf.notifyVo.Length]; for (int i = 0; i < QuickPayConf.notifyVo.Length; i++) { resArr[i] = Request.Params[QuickPayConf.notifyVo[i]]; } String signature = Request.Params[QuickPayConf.signature]; String signMethod = Request.Params[QuickPayConf.signMethod]; Response.ContentType = "text/html;charset=" + QuickPayConf.charset; Response.ContentEncoding = System.Text.Encoding.GetEncoding(QuickPayConf.charset); try { bool signatureCheck = new QuickPayUtils().checkSign(resArr, signMethod, signature); StringBuilder sb = new StringBuilder(); //sb.Append("签名是否正确:" + signatureCheck); bool success = resArr[10] == "00"; if (success) { string moneyz = resArr[13]; lab_OrderNo.Text = resArr[8]; //资源交易号 lab_Point.Text = Convert.ToString(Convert.ToInt32(moneyz) / 100); //实际支付金额 lab_aliNo.Text = resArr[9]; //外部交易号 //先充值 后消费 string loginname = this.Page.User.Identity.Name; Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); bool b = dal.StrikeSuccess(lab_OrderNo.Text.ToString().Trim(), "alipay", resArr[9], loginname); } else { sb.Append("<br>失败原因:" + resArr[11]); Response.Write(sb.ToString()); } Response.Write(sb.ToString()); } catch (Exception) { } } }
public void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e) { if (Session["valationNo"] != null && txtB_yz.Text.Trim().ToLower() == Session["valationNo"].ToString().ToLower()) { if (txtB_Name.Text.Trim() != "") { if (txtB_CzName.Text.Trim() != "" && txtB_CzName.Text.Trim() == txtB_ReCzName.Text.Trim()) { Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "tenpay"; model.LoginName = Page.User.Identity.Name; //充值人 model.StrikeLoginName = txtB_CzName.Text.Trim(); //你的财付通充值帐户 model.TotalCount = Convert.ToDouble(txtB_PayPoint.Text.Trim()); model.BuyType = "Pre-Paid"; //购买类型 model.remark = txtB_Name.Text.Trim() + "使用财付通充值" + txtB_PayPoint.Text.Trim() + "元"; //备注 int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { string postForm = OnlineStrike.tenForm(orderno.ToString(), txtB_PayPoint.Text.Trim(), txtB_Name.Text.Trim()); Response.Redirect(postForm); } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "充值帐号不为空或者确认充值帐号不正确!"); return; } } else { Tz888.Common.MessageBox.Show(this.Page, "财付通帐号不为空!"); return; } } else { Tz888.Common.MessageBox.Show(this.Page, "验证码错误!"); return; } }
protected void Button1_Click(object sender, EventArgs e) { //if (Session["valationNo"] != null && txtB_yz.Text.Trim().ToLower() == Session["valationNo"].ToString().ToLower()) //{ if (txtB_Name.Text.Trim() != "" && txtB_Name.Text.Trim() == txtB_ReName.Text.Trim()) { string htmlFile = ""; Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "QuickPay"; model.LoginName = Page.User.Identity.Name; //充值人 model.StrikeLoginName = txtB_Name.Text.Trim(); //充值帐户 model.TotalCount = Convert.ToDouble(txtB_PayPoint.Text.Trim()); model.BuyType = "Pre-Paid"; //购买类型 model.remark = txtB_Name.Text.Trim() + "使用在线充值" + txtB_PayPoint.Text.Trim() + "元"; //备注 int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { int money = Convert.ToInt32(txtB_PayPoint.Text.Trim()); money = money * 100; QuickPaySample quick = new QuickPaySample(); if (money > 0 || orderno > 0) { quick.ProcessRequestList(htmlFile, "中国招商投资网资源信息", Convert.ToString(orderno), Convert.ToString(money), Page.User.Identity.Name); } } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "帐号不为空或者确认帐号不正确!"); return; } //} //else //{ // Tz888.Common.MessageBox.Show(this.Page, "验证码错误!"); // return; //} }
protected void Page_Load(object sender, EventArgs e) { if (Page.User.Identity.Name == null || Page.User.Identity.Name.Trim() == "") { Response.Redirect("../Login.aspx"); } string loginname = Page.User.Identity.Name; string key = OnlineStrike.getTenKey(); //密钥 PayResponseHandler resHandler = new PayResponseHandler(Context); //创建PayResponseHandler实例 resHandler.setKey(key); if (resHandler.isTenpaySign()) //判断签名 { string transaction_id = resHandler.getParameter("transaction_id"); //交易单号 string total_fee = resHandler.getParameter("total_fee"); //金额金额,以分为单位 total_fee = Convert.ToString(Convert.ToInt32(total_fee) / 100); string pay_result = resHandler.getParameter("pay_result"); //支付结果 string orderNo = transaction_id.Substring(17, 10).Trim(); lab_OrderNo.Text = orderNo; lab_Point.Text = total_fee.Trim(); lab_TenNo.Text = transaction_id.Trim(); if ("0".Equals(pay_result)) { //开始处理业务 Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); bool b = dal.StrikeSuccess(orderNo, "tenpay", transaction_id, loginname); //调用doShow, 打印meta值跟js代码,告诉财付通处理成功,并在用户浏览器显示$show页面. resHandler.doShow("http://member.topfo.com/PayManage/show.aspx"); } else { Response.Write("支付失败"); //当做不成功处理 } } else { Response.Write("认证签名失败"); //string debugInfo = resHandler.getDebugInfo(); //Response.Write("<br/>debugInfo:" + debugInfo); } }
protected void Button1_Click(object sender, EventArgs e) { //if (Session["valationNo"] != null && txtB_yz.Text.Trim().ToLower() == Session["valationNo"].ToString().ToLower()) //{ if (txtB_Name.Text.Trim() != "" && txtB_Name.Text.Trim() == txtB_ReName.Text.Trim()) { Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "alipay"; model.LoginName = txtB_Name.Text.Trim(); //充值人 model.StrikeLoginName = txtB_Name.Text.Trim(); //充值帐户 model.TotalCount = Convert.ToDouble(txtB_PayPoint.Text.Trim()); model.BuyType = "Pre-Paid"; //购买类型 model.remark = txtB_Name.Text.Trim() + "使用支付宝充值" + txtB_PayPoint.Text.Trim() + "元"; //备注 int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { string posturl = OnlineStrike.alipayForm(orderno.ToString(), txtB_PayPoint.Text.Trim()); Response.Redirect(posturl); } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "支付宝帐号不为空或者确认帐号不正确!"); return; } //} //else //{ // Tz888.Common.MessageBox.Show(this.Page, "验证码错误!"); // return; //} }
protected void btnStatus_Click(object sender, EventArgs e) { string LoginName = bp.LoginName; if (txtLoginName.Text.Trim() != "") { MemberInfoBLL memberBll = new MemberInfoBLL(); int result = memberBll.ValideNameUseable(txtLoginName.Text.Trim()); if (result > 0) { //不可用 Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "bank"; model.LoginName = LoginName; //充值人 model.StrikeLoginName = txtLoginName.Text.Trim(); //充值帐户 model.TotalCount = Convert.ToDouble(txtMoney.Text.Trim()); model.BuyType = "Pre-Paid"; //购买类型 if (txtBank.Text.ToString().Trim() == "") { model.remark = txtLoginName.Text.Trim() + "使用银行汇款充值" + txtMoney.Text.Trim() + "元" + " 操作人 " + LoginName; //备注 } else { model.remark = txtBank.Text.ToString().Trim(); } model.OperationMan = LoginName; int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { Tz888.BLL.StrikeOrder dall = new Tz888.BLL.StrikeOrder(); bool b = dall.StrikeSuccess(Convert.ToString(orderno), "bank", "", LoginName); if (b) { Tz888.BLL.Order.BusStrikeRecBLL RecBLL = new Tz888.BLL.Order.BusStrikeRecBLL(); Tz888.Model.Orders.BusStrikeRecTab BusModel = new Tz888.Model.Orders.BusStrikeRecTab(); BusModel.CardNo = Convert.ToInt64(orderno); BusModel.ChangeBy = LoginName; BusModel.ChangeTime = System.DateTime.Now; BusModel.Email = txtEmail.Text.ToString().Trim(); BusModel.Tel = txtTelCountry.Value.ToString().Trim() + txtTelZoneCode.Value.ToString().Trim() + txtTelNumber.Value.ToString().Trim(); BusModel.PointCount = Convert.ToDecimal(txtMoney.Text.ToString().Trim()); if (txtBank.Text.ToString().Trim() == "") { model.remark = txtLoginName.Text.Trim() + "使用银行汇款充值" + txtMoney.Text.Trim() + "元" + " 操作人 " + LoginName; //备注 } else { model.remark = txtBank.Text.ToString().Trim(); } BusModel.StrikeType = "bank"; BusModel.Mobile = txtMobile.Value.ToString().Trim(); BusModel.LoginName = txtLoginName.Text.ToString().Trim(); BusModel.Free = Convert.ToInt32(sType.Value.Trim()); int num = RecBLL.Add(BusModel); if (num > 0) { Tz888.Common.MessageBox.Show(this.Page, "充值成功!"); } } } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "充值帐号不正确请重新输入!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "帐号不为空或者帐号不正确!"); return; } }
protected void Button2_Click1(object sender, EventArgs e) { Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); bool b = dal.StrikeSuccess("1000000338", "pnr", "2005", "huanglelou"); }
protected void Page_Load(object sender, EventArgs e) { /// <summary> /// created by sunzhizhi 2006.5.21,[email protected]。 /// </summary> string partner = "2088001390620672"; //partner合作伙伴id(必须填写) string key = "kf69mv76m23a9vp34nkz6s16aux29h29"; //partner 的对应交易安全校验码(必须填写) string alipayNotifyURL = "https://www.alipay.com/cooperate/gateway.do?"; alipayNotifyURL = alipayNotifyURL + "service=notify_verify" + "&partner=" + partner + "¬ify_id=" + Request.Form["notify_id"]; //获取支付宝ATN返回结果,true是正确的订单信息,false 是无效的 string responseTxt = Get_Http(alipayNotifyURL, 120000); int i; NameValueCollection coll; coll = Request.Form; //Load Form variables into NameValueCollection variable. String[] requestarr = coll.AllKeys; // Get names of all forms into a string array. string[] Sortedstr = BubbleSort(requestarr); //进行排序; //构造待md5摘要字符串 ; string prestr = ""; for (i = 0; i < Sortedstr.Length; i++) { if (Request.Form[Sortedstr[i]] != "" && Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type") { if (i == Sortedstr.Length - 1) { prestr = prestr + Sortedstr[i] + "=" + Request.Form[Sortedstr[i]]; } else { prestr = prestr + Sortedstr[i] + "=" + Request.Form[Sortedstr[i]] + "&"; } } } prestr = prestr + key; string mysign = GetMD5(prestr); string sign = Request.Form["sign"]; if (mysign == sign && responseTxt == "true") //验证支付发过来的消息,签名是否正确 { //先充值 后消费 string loginname = this.Page.User.Identity.Name; //业务逻辑处理 string orderNo = Request.QueryString["out_trade_no"].ToString().Trim(); string transaction_id = Request.QueryString["trade_no"].Trim(); string total_fee = Request.QueryString["total_fee"].Trim();; Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); bool b = dal.StrikeSuccess(orderNo, "alipay", transaction_id, loginname); //if (b) //{ // Tz888.Common.MessageBox.Show(this.Page, "RECV_ORD_ID_" + orderNo); //} //else //{ // Tz888.Common.MessageBox.Show(this.Page, "充值未成功,请联系我们的客服!"); //} } else { Tz888.Common.MessageBox.Show(this.Page, "交易失败!"); } }
protected void Page_Load(object sender, EventArgs e) { //lblPnr.Text = Request.QueryString["out_trade_no"].Trim(); //资源交易号 //lblSys.Text = Request.QueryString["trade_no"].Trim(); //外部交易号 //lblPayPoint.Text = Request.QueryString["total_fee"].Trim(); //实际支付金额 //lblPoint.Text = bll.getTotalFee(Convert.ToInt64(lblPnr.Text)); //需要支付的点数 lab_OrderNo.Text = Request.QueryString["out_trade_no"].Trim(); //资源交易号 lab_Point.Text = Request.QueryString["total_fee"].Trim(); //实际支付金额 lab_aliNo.Text = Request.QueryString["trade_no"].Trim(); //外部交易号 order_no = Request.QueryString["out_trade_no"].Trim(); /// <summary> /// created by sunzhizhi 2006.5.21,[email protected]。 /// </summary> string partner = "2088001390620672"; //***partner合作伙伴id(必须填写) string key = "kf69mv76m23a9vp34nkz6s16aux29h29"; //**partner 的对应交易安全校验码(必须填写) string alipayNotifyURL = "http://notify.alipay.com/trade/notify_query.do?"; alipayNotifyURL = alipayNotifyURL + "service=notify_verify" + "&partner=" + partner + "¬ify_id=" + Request.QueryString["notify_id"]; //获取支付宝ATN返回结果,true是正确的订单信息,false 是无效的 string responseTxt = Get_Http(alipayNotifyURL, 120000); int i; NameValueCollection coll; coll = Request.QueryString; //Load Form variables into NameValueCollection variable String[] requestarr = coll.AllKeys; // Get names of all forms into a string array. //进行排序; string[] Sortedstr = BubbleSort(requestarr); // for (i = 0; i < Sortedstr.Length; i++) // { // Response.Write("Form: " + Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "<br>"); // } //构造待md5摘要字符串 ; StringBuilder prestr = new StringBuilder(); for (i = 0; i < Sortedstr.Length; i++) { if (Request.Form[Sortedstr[i]] != "" && Sortedstr[i] != "sign" && Sortedstr[i] != "sign_type") { if (i == Sortedstr.Length - 1) { prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]]); } else { prestr.Append(Sortedstr[i] + "=" + Request.QueryString[Sortedstr[i]] + "&"); } } } prestr.Append(key); //生成Md5摘要; string mysign = GetMD5(prestr.ToString()); string sign = Request.QueryString["sign"]; if (mysign == sign && responseTxt == "true") //验证支付发过来的消息,签名是否正确 { //先充值 后消费 string loginname = this.Page.User.Identity.Name; //业务逻辑处理 string orderNo = Request.QueryString["out_trade_no"].ToString().Trim(); string transaction_id = Request.QueryString["trade_no"].Trim(); string total_fee = Request.QueryString["total_fee"].Trim();; Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); bool b = dal.StrikeSuccess(orderNo, "alipay", transaction_id, loginname); } }
protected void Button1_Click(object sender, EventArgs e) { string LoginName = this.Page.User.Identity.Name; if (txtLoginName.Text.Trim() != "") { int result = 0; MemberInfoBLL memberBll = new MemberInfoBLL(); int result1 = memberBll.ValideNameUseable(txtLoginName.Text.Trim()); if (result1 > 0) { result = memberBll.RechargeCard(txtNumber.Text.ToString().Trim()); } else { Tz888.Common.MessageBox.Show(this.Page, "充值帐号不正确请重新输入!"); } if (result > 0) { //不可用 int passresult = memberBll.CardPassWord(txtNumber.Text.ToString().Trim(), txtpassword.Text.ToString().Trim()); if (passresult > 0) { int state = memberBll.RechargeStateCard(txtNumber.Text.ToString().Trim()); if (state == 0) { string Money = memberBll.CarMoney(txtNumber.Text.ToString().Trim()); Tz888.Model.StrikeOrder model = new Tz888.Model.StrikeOrder(); Tz888.BLL.StrikeOrder dal = new Tz888.BLL.StrikeOrder(); model.PayTypeCode = "Card"; model.LoginName = LoginName; //充值人 model.StrikeLoginName = txtLoginName.Text.Trim(); //充值帐户 model.TotalCount = Convert.ToDouble(Money); model.BuyType = "Pre-Paid"; //购买类型 if (txtBank.Text.ToString().Trim() == "") { model.remark = txtLoginName.Text.Trim() + "使用银行汇款充值" + Money + "元" + " 操作人 " + LoginName;//备注 } else { model.remark = txtBank.Text.ToString().Trim(); } model.OperationMan = LoginName; int orderno = dal.CreateStrikeOrder(model); if (orderno > 0) { Tz888.BLL.StrikeOrder dall = new Tz888.BLL.StrikeOrder(); bool b = dall.RechargeCardSuccess(Convert.ToString(orderno), "Card", "", LoginName, txtNumber.Text.ToString().Trim(), Convert.ToInt32(1)); if (b) { Tz888.BLL.Order.BusStrikeRecBLL RecBLL = new Tz888.BLL.Order.BusStrikeRecBLL(); Tz888.Model.Orders.BusStrikeRecTab BusModel = new Tz888.Model.Orders.BusStrikeRecTab(); BusModel.CardNo = Convert.ToInt64(orderno); BusModel.ChangeBy = LoginName; BusModel.ChangeTime = System.DateTime.Now; BusModel.Email = txtEmail.Text.ToString().Trim(); BusModel.Tel = txtTelCountry.Value.ToString().Trim() + txtTelZoneCode.Value.ToString().Trim() + txtTelNumber.Value.ToString().Trim(); BusModel.PointCount = Convert.ToDecimal(Money); if (txtBank.Text.ToString().Trim() == "") { BusModel.Remark = txtLoginName.Text.Trim() + "使用银行汇款充值" + Money + "元" + " 操作人 " + LoginName;//备注 } else { BusModel.Remark = txtBank.Text.ToString().Trim(); } BusModel.StrikeType = "Card"; BusModel.Mobile = txtMobile.Value.ToString().Trim(); BusModel.LoginName = txtLoginName.Text.ToString().Trim(); BusModel.Free = Convert.ToInt32(1); BusModel.CardNumber = txtNumber.Text.ToString().Trim(); int num = RecBLL.Add(BusModel); if (num > 0) { Tz888.Common.MessageBox.Show(this.Page, "充值成功!"); } } } else { Tz888.Common.MessageBox.Show(this.Page, "订单提交失败!请重试!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "该卡号已充值,不能重复充值!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "充值卡密码不正确请重新输入!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "充值卡号不正确请重新输入!"); } } else { Tz888.Common.MessageBox.Show(this.Page, "帐号不为空或者帐号不正确!"); return; } }