private bool WriteUserAccount(string Memo) { if (this.Money == 0.0) { return(false); } double num = this.so["OnlinePay_Tenpay_PayFormalitiesFeesScale"].ToDouble(0.0) / 100.0; double formalitiesFees = this.Money - Math.Round((double)(this.Money / (num + 1.0)), 2); this.Money -= formalitiesFees; string returnDescription = ""; bool flag = base._User.AddUserBalance(this.Money, formalitiesFees, this.sp_billno, this.getBankName(this.bankPay), Memo, ref returnDescription) == 0; if (flag) { return(flag); } DataTable table = new Tables.T_UserPayDetails().Open("Result", "[id] = " + _Convert.StrToLong(this.sp_billno, 0L).ToString(), ""); if ((table == null) || (table.Rows.Count == 0)) { return(false); } return(_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1); }
private bool WriteUserAccount(Users _User, string orderid, string amount, string Memo) { double money = _Convert.StrToDouble(amount, 0.0); if (money != 0.0) { double num2 = this.so["OnlinePay_Alipay_PayFormalitiesFeesScale"].ToDouble(0.0) / 100.0; double formalitiesFees = money - Math.Round((double)(money / (num2 + 1.0)), 2); money -= formalitiesFees; string returnDescription = ""; bool flag = _User.AddUserBalance(money, formalitiesFees, orderid, "支付宝支付," + this.so["OnlinePay_Alipay_UserName"].ToString(""), Memo, ref returnDescription) == 0; if (flag) { return(flag); } DataTable table = new Tables.T_UserPayDetails().Open("Result", "[id] = " + _Convert.StrToLong(orderid, 0L).ToString(), ""); if ((table == null) || (table.Rows.Count == 0)) { new Log("System").Write("在线支付:返回的交易号找不到对应的数据"); return(false); } if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1) { return(true); } new Log("System").Write("在线支付:对应的数据未处理"); } return(false); }
private bool WriteUserAccount(Users thisUser, string PayNumber, double PayMoney, string Memo) { if (PayMoney > 0.0) { double num = this.so["OnlinePay_YeePay_PayFormalitiesFeesScale"].ToDouble(0.0) / 100.0; double formalitiesFees = PayMoney - Math.Round((double)(PayMoney / (num + 1.0)), 2); double money = PayMoney - formalitiesFees; string returnDescription = ""; bool flag = thisUser.AddUserBalance(money, formalitiesFees, PayNumber, "易宝", Memo, ref returnDescription) == 0; if (flag) { return(flag); } DataTable table = new Tables.T_UserPayDetails().Open("Result", "[id] = " + _Convert.StrToLong(PayNumber, 0L).ToString(), ""); if ((table == null) || (table.Rows.Count == 0)) { new Log("OnlinePay").Write("[易宝]在线支付:返回的交易号找不到对应的数据"); return(false); } if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1) { return(true); } new Log("OnlinePay").Write("[易宝]在线支付:对应的数据未处理"); } return(false); }
private void Page_Load(object sender, EventArgs e) { string errmsg = ""; this.key = this.so["OnlinePay_Tenpay_MD5Key"].Value.ToString(); this.bargainor_id = this.so["OnlinePay_Tenpay_UserNumber"].Value.ToString(); if (this.GetQueryValueFromUrl(base.Request.QueryString, out errmsg)) { if (this.pay_result != 0) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sp_billno + " 的支付记录没有充值成功,描述:" + this.payerrmsg + "\");</script>"); } else { try { string memo = "系统交易号:" + this.sp_billno + ",财付通交易号:" + this.transaction_id; int returnValue = -1; string returnDescription = ""; DataTable table = new Tables.T_UserPayDetails().Open("", "ID=" + this.sp_billno, ""); if ((table == null) || (table.Rows.Count <= 0)) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sp_billno + " 的支付记录没有充值成功,描述:充值处理失败,本条数据丢失。\");</script>"); } else { double money = _Convert.StrToDouble(table.Rows[0]["Money"].ToString(), 0.0); long userID = _Convert.StrToLong(table.Rows[0]["UserID"].ToString(), 0L); double formalitiesFees = _Convert.StrToDouble(table.Rows[0]["FormalitiesFees"].ToString(), 0.0); string[] strArray = table.Rows[0]["PayType"].ToString().Split(new char[] { '_' }); string bankCode = (strArray.Length < 2) ? "" : strArray[1]; if (Procedures.P_UserAddMoney(base._Site.ID, userID, money, formalitiesFees, this.sp_billno, this.getBankName(bankCode), memo, ref returnValue, ref returnDescription) < 0) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sp_billno + " 的支付记录没有充值成功,描述:数据库读写错误\");</script>"); } else if (returnValue < 0) { base.Response.Write("<script type=\"text/javascript\">alert(\"" + returnDescription + "\");</script>"); } else { base.Response.Write("<script type=\"text/javascript\">alert(\"此笔充值记录已到帐并已处理成功!\");</script>"); } } } catch { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sp_billno + " 的支付记录没有充值成功,描述:查询失败,可能是网络通讯故障。请重试一次。\");</script>"); } } } else { errmsg = "认证签名失败"; base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sp_billno + " 的支付记录没有充值成功,描述:" + errmsg + "\");</script>"); } }
protected void gUserPay_ItemCommand(object source, DataGridCommandEventArgs e) { HiddenField field = (HiddenField)e.Item.FindControl("tdUserPayDetail"); int num = _Convert.StrToInt(field.Value.ToString(), 0); string bankCode = ""; string str2 = ""; string str3 = ""; if (e.CommandName == "ShowUserPayDetail") { this.isShowUserPay.Visible = true; DataTable table = new Tables.T_UserPayDetails().Open("PayType , [Money] , [DateTime]", "id = " + num, ""); bankCode = table.Rows[0]["PayType"].ToString(); str2 = table.Rows[0]["Money"].ToString(); str3 = table.Rows[0]["DateTime"].ToString(); this.lblUserPayBank.Text = this.getBankName(bankCode); this.lblUserPayMoneys.Text = str2.Substring(0, str2.IndexOf('.')) + str2.Substring(str2.IndexOf('.'), 3); this.lblUserPayTime.Text = str3; } this.BindUserPayData(); this.BindDistills(); }
protected void Page_Load(object sender, EventArgs e) { this.customerid = this.so["OnlinePay_ZhiFuKa_UserNumber"].Value.ToString(); this.key = this.so["OnlinePay_ZhiFuKa_MD5Key"].Value.ToString(); this.sdcustomno = Utility.GetRequest("sdcustomno"); if ((string.IsNullOrEmpty(this.sdcustomno) || string.IsNullOrEmpty(this.customerid)) || string.IsNullOrEmpty(this.key)) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:参数不齐全,无法提交查询!\"); window.location.href='';</script>"); } else { string url = ""; if (!this.GetQueryUrl(out url)) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:" + url + "!\");window.location.href='';</script>"); } else { string str2 = ""; if (this.GetResponseContents(this.GetHtml(url, "GB2312", 200), out str2)) { base.Response.Write("<script type=\"text/javascript\">alert(\"支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:" + str2 + "!\"); window.location.href='';</script>"); } else { try { string memo = "系统交易号:" + this.sdcustomno + ",51支付交易号:" + this.sd51no; int returnValue = -1; string returnDescription = ""; DataTable table = new Tables.T_UserPayDetails().Open("", "ID=" + this.sdcustomno, ""); if ((table == null) || (table.Rows.Count <= 0)) { JavaScript.Alert(this.Page, "支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:充值处理失败,本条数据丢失。"); } else { double money = (this.ordermoney == -1.0) ? this.ordermoney : _Convert.StrToDouble(table.Rows[0]["Money"].ToString(), 0.0); long userID = _Convert.StrToLong(table.Rows[0]["UserID"].ToString(), 0L); double formalitiesFees = _Convert.StrToDouble(table.Rows[0]["FormalitiesFees"].ToString(), 0.0); string[] strArray3 = table.Rows[0]["PayType"].ToString().Split(new char[] { '_' }); string bankCode = (strArray3.Length < 2) ? "" : strArray3[1]; if (Procedures.P_UserAddMoney(base._Site.ID, userID, money, formalitiesFees, this.sdcustomno, this.getBankName(bankCode), memo, ref returnValue, ref returnDescription) < 0) { JavaScript.Alert(this.Page, "支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:数据库读写错误"); } else if (returnValue < 0) { JavaScript.Alert(this.Page, returnDescription); } else { JavaScript.Alert(this.Page, "此笔充值记录已到帐并已处理成功!"); } } } catch { JavaScript.Alert(this.Page, "支付号为 " + this.sdcustomno + " 的支付记录没有充值成功,描述:查询失败,可能是网络通讯故障。请重试一次。"); } } } } }
protected void Page_Load(object sender, EventArgs e) { this.key = this.so["OnlinePay_007Ka_Key"].ToString(""); try { this.SettingParams(); } catch { this.errorMessage = "007订单查询结果:回调参数有误!"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); return; } try { if (base.Request.QueryString.AllKeys.Length < 1) { this.errorMessage = this.OrderID + "订单查询结果:该数据传输丢失!"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else if (this.SignCounterpart != this.GetMD5(this.Orderinfo + "|" + this.key)) { this.errorMessage = this.OrderID + "订单查询结果:认证签名失败!"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else if ((this.TranStat.ToString().Trim() != "1") && (this.TranStat.ToString().Trim() != "29")) { this.errorMessage = this.OrderID + "订单查询结果:007手机卡充值失败!错误号:" + this.TranStat.ToString() + " 错误描述:" + this.TranInfo + "(" + this.GetTranStatToStringCH(_Convert.StrToInt(this.TranStat.ToString(), 0)) + ")"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else { DataTable table = new Tables.T_UserPayDetails().Open("Result,UserID", "ID=" + this.OrderID, ""); if ((table == null) || (table.Rows.Count < 1)) { this.errorMessage = this.OrderID + "订单查询结果:支付号不存在,数据可能已近丢失!"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else if (_Convert.StrToInt(table.Rows[0][1].ToString(), 0) != 0) { if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1) { this.errorMessage = this.OrderID + "订单充值已经成功!"; base.Response.Write("OK"); new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else { int returnValue = -20000; string returnDescription = ""; double num2 = this.so["OnlinePay_007Ka_FormalitiesFees"].ToDouble(0.0) / 100.0; double formalitiesFees = Math.Round((double)((_Convert.StrToDouble(this.Value, 0.0) / 100.0) * num2), 2); long userID = _Convert.StrToLong(table.Rows[0][1].ToString(), 0L); Procedures.P_UserAddMoney(1L, userID, (_Convert.StrToDouble(this.Value, 0.0) / 100.0) - formalitiesFees, formalitiesFees, this.OrderID, "007KA", "007KA系统交易号" + this.OrderID, ref returnValue, ref returnDescription); if (returnValue < 0) { this.errorMessage = this.OrderID + "订单查询结果:增加电子货币错误。错误原因:" + returnDescription; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else { this.errorMessage = this.OrderID + "订单充值成功!"; base.Response.Write("OK"); new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } } } else { this.errorMessage = this.OrderID + "订单查询结果:充值未完成!错误原因:用户不存在"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } } } catch { this.errorMessage = this.OrderID + "订单查询结果:错误描述:出现未知异常!"; new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } }
protected void Page_Load(object sender, EventArgs e) { string str = Utility.GetUrl() + "/Home/Room/OnlinePay/"; try { this.SettingParams(); } catch (Exception exception) { this.errorMessage = "007在线充值:充值未完成。错误描述:参数有误 详细:" + exception.Message; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); return; } this.key = this.so["OnlinePay_007Ka_Key"].ToString(""); if (base.Request.QueryString.AllKeys.Length >= 1) { if (this.SignCounterpart != this.GetMD5(this.Orderinfo)) { this.errorMessage = "007在线充值:充值未完成。错误描述:认证签名失败!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else if (this.MerID != this.so["OnlinePay_007Ka_MerchantId"].ToString("").Trim()) { this.errorMessage = "007在线充值:充值未完成。错误描述:商户号错误,数据非法!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else if (this.MerAccount != this.so["OnlinePay_007Ka_MerAccount"].ToString("").Trim()) { this.errorMessage = "007在线充值:充值未完成。错误描述:商户银行账号错误,数据非法!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else if ((this.TranStat.ToString().Trim() != "1") && (this.TranStat.ToString().Trim() != "29")) { this.errorMessage = "007充值失败。"; new Log("OnlinePay").Write(this.errorMessage + " 错误号:" + this.TranStat.ToString() + " 错误描述:" + this.TranInfo); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else { DataTable table = new Tables.T_UserPayDetails().Open("Result,UserID", "ID=" + this.OrderID, ""); if ((table == null) || (table.Rows.Count < 1)) { this.errorMessage = "007在线充值:充值未完成。错误描述:生成支付流水号未成功。"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else if (_Convert.StrToLong(table.Rows[0][1].ToString(), 0L) != 0L) { if (_Convert.StrToInt(table.Rows[0][0].ToString(), 0) == 1) { this.errorMessage = this.OrderID + "订单充值已经成功!"; base.Response.Write("OK"); new Log("OnlinePay").Write(this.errorMessage); JavaScript.Alert(this.Page, this.errorMessage); } else { string returnDescription = ""; double num = this.so["OnlinePay_007Ka_FormalitiesFees"].ToDouble(0.0) / 100.0; double formalitiesFees = Math.Round((double)((_Convert.StrToDouble(this.Value, 0.0) / 100.0) * num), 2); Users users = new Users(base._Site.ID)[base._Site.ID, _Convert.StrToLong(table.Rows[0][1].ToString(), 0L)]; if (users.AddUserBalance((_Convert.StrToDouble(this.Value, 0.0) / 100.0) - formalitiesFees, formalitiesFees, this.OrderID, "007Ka", "系统交易号:" + this.OrderID + "007Ka支付", ref returnDescription) < 0) { this.errorMessage = "增加电子货币错误。错误原因:" + returnDescription; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } else { base.Response.Write("OK"); this.errorMessage = "007在线充值:充值完成!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(Utility.GetUrl() + "/Home/Room/OnlinePay/OK.aspx?BuyID=" + this.Attach); } } } else { this.errorMessage = "007在线充值:充值未完成。错误描述:用户不存在!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(Utility.GetUrl() + "/Home/Room/OnlinePay/OK.aspx?BuyID=" + this.Attach); } } } else { this.errorMessage = "007在线充值:充值未完成。错误描述:数据传输错误!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.Redirect(str + "Fail.aspx?errMsg=" + this.errorMessage); } }
protected void Page_Load(object sender, EventArgs e) { try { this.SettingParams(); } catch (Exception exception) { this.errorMessage = "通知错误:错误错误描述:007Ka回调页面参数列表!"; new Log("OnlinePay").Write(this.errorMessage + " 错误信息:" + exception.Message); base.Response.End(); return; } base.Response.Write("OK"); this.key = this.so["OnlinePay_007Ka_Key"].ToString("").Trim(); if (!(this.Sign != this.GetMD5(this.Orderinfo))) { if (this.MerID != this.so["OnlinePay_007Ka_MerchantId"].ToString("").Trim()) { this.errorMessage = "通知错误:充值未完成。错误描述:商户号错误,数据非法!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } else if (this.MerAccount != this.so["OnlinePay_007Ka_MerAccount"].ToString("").Trim()) { this.errorMessage = "通知错误:充值未完成。错误描述:银行账号错误,数据非法!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } else if ((this.TranStat.ToString().Trim() != "1") && (this.TranStat.ToString().Trim() != "29")) { this.errorMessage = "通知错误:充值未完成。错误号:" + this.TranStat + "错误描述:" + this.TranInfo; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } else { DataTable table = new Tables.T_UserPayDetails().Open("Result,UserID", "ID=" + this.OrderID, ""); if ((table == null) || (table.Rows.Count < 1)) { this.errorMessage = "通知错误:充值未完成。错误描述:数据库错误。关联错误:获取支付流水号未成功。"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } else if (_Convert.StrToLong(table.Rows[0][0].ToString(), 0L) == 0L) { string returnDescription = ""; int returnValue = 1; double num2 = this.so["OnlinePay_007Ka_FormalitiesFees"].ToDouble(0.0) / 100.0; double formalitiesFees = Math.Round((double)((_Convert.StrToDouble(this.Value, 0.0) / 100.0) * num2), 2); Procedures.P_UserAddMoney(1L, _Convert.StrToLong(table.Rows[0][1].ToString(), 0L), (_Convert.StrToDouble(this.Value, 0.0) / 100.0) - formalitiesFees, formalitiesFees, this.OrderID, "007Ka", "系统交易号:" + this.OrderID + "007Ka支付", ref returnValue, ref returnDescription); if (returnValue < 0) { this.errorMessage = "通知错误:充值未完成。错误描述:增加电子货币错误。错误原因:" + returnDescription; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } else { this.errorMessage = "007在线充值:充值完成"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } } else { this.errorMessage = "007在线充值:充值完成"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } } } else { this.errorMessage = "通知错误:充值未完成。错误描述:认证签名失败!"; new Log("OnlinePay").Write(this.errorMessage); base.Response.End(); } }