protected void Page_Load(object sender, EventArgs e) { Log.Info(this.GetType().ToString(), "进入回调页面....."); ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); }
public void PayCallBack() { System.Web.UI.Page page = new System.Web.UI.Page(); ResultNotify resultNotify = new ResultNotify(page); resultNotify.ProcessNotify(); }
protected void Page_Load(object sender, EventArgs e) { LogHelper.Write("支付中:---------"); ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); }
protected void Page_Load(object sender, EventArgs e) { ResultNotify resultNotify = new ResultNotify(this); //扫码回调调用没有参数的 resultNotify.ProcessNotify(); }
/// <summary> /// 支付成功后的回调函数 /// </summary> /// <returns></returns> public ActionResult ResultNotify() { ResultNotify resultNotify = new ResultNotify(Request.InputStream); resultNotify.ProcessNotify(); return(View()); }
public string ProcessNotify(Stream IntpuStream, out WxPayData notifyData) { var notifyProcessor = new ResultNotify(); //WxPayData notifyData; var responseStr = notifyProcessor.ProcessNotify(IntpuStream, out notifyData); return(responseStr); }
protected void Page_Load(object sender, EventArgs e) { log.Info("==========微信异步回调开始==============="); ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); log.Info("==========微信异步回调结束==============="); }
protected void Page_Load(object sender, EventArgs e) { try { ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { string orderUUID = Request["OrderUUID"]; WCFClient.LoggerService.Info("微信回调成功(OrderUUID):" + (string.IsNullOrWhiteSpace(orderUUID) ? string.Empty : orderUUID)); lock (LockObject.Instance) { ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); } }
/// <summary> /// 微信官网通知接口 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { try { ResultNotify resultNotify = new ResultNotify(this); int pid = int.Parse(Request.QueryString["pid"].ToString()); resultNotify.ProcessNotify(pid); } catch (Exception ex) { Response.Write("非法访问"); } }
/// <summary> /// JsApi微信回调 /// </summary> public static void Notify(Action <NotifyModel> action) { try { Log.Info("Notify", "微信Notify被回调"); var context = System.Web.HttpContext.Current; ResultNotify resultNotify = new ResultNotify(context); resultNotify.ProcessNotify(action); } catch (Exception ex) { Log.Error("Error", ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { PayConfig payConfig = new PayConfig(); SiteSettings masterSettings = SettingsManager.GetMasterSettings(); payConfig.AppId = masterSettings.WeixinAppId; payConfig.AppSecret = masterSettings.WeixinAppSecret; payConfig.Key = masterSettings.WeixinPartnerKey; payConfig.MchID = masterSettings.WeixinPartnerID; payConfig.SSLCERT_PATH = masterSettings.WeixinCertPath; payConfig.SSLCERT_PASSWORD = masterSettings.WeixinCertPassword; ResultNotify resultNotify = new ResultNotify(this.Page, payConfig); resultNotify.ProcessNotify(); }
protected void Page_Load(object sender, EventArgs e) { lock (this) { //try //{ Log.Debug(this.GetType().ToString(), "--进入回调--"); ResultNotify resultNotify = new ResultNotify(this); resultNotify.ProcessNotify(); //} //catch(Exception ex) //{ // Log.Error(this.GetType().ToString(),ex.Message); //} } }
public PayOrder CompletePayOrderAndReback(HttpContext httpContext, out string successStr) { ResultNotify resultNotify = new ResultNotify(httpContext); WxPayData WxPayData = resultNotify.ProcessNotify(); PayOrder payOrder = null; successStr = ""; if (WxPayData != null) { payOrder = CompletePayOrder(WxPayData); WxPayData res = new WxPayData(); res.SetValue("return_code", "SUCCESS"); res.SetValue("return_msg", "OK"); // httpContext.Response.WriteAsync(); successStr = res.ToXml(); } return(payOrder); }
public ActionResult Notify() { Log.Error(this.GetType().ToString(), "transaction_id===>微信回调开始"); ResultNotify result = new ResultNotify(Request.InputStream); WxPayData handlerRes = result.ProcessNotify(); string out_trade_no = handlerRes.GetValue("out_trade_no").ToString(); string resXml = string.Empty; Log.Error(this.GetType().ToString(), "transaction_id===>111111"); //支付成功后处理 if (handlerRes.GetValue("return_code").ToString() == "SUCCESS") { resXml = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> "; string transaction_id = handlerRes.GetValue("transaction_id").ToString(); Log.Error(this.GetType().ToString(), "transaction_id===>" + transaction_id); WxPayData orderCheck = null; //CheckTransactionidPayState(transaction_id, out_trade_no); if (true) { var status = _rechargeOrderContract.RechargeOrders.Where(x => x.Prepay_Id == transaction_id && x.order_Uid == out_trade_no) .Select(x => x.pay_status).ToList().FirstOrDefault(); if (status != 1) { using (var a = _rechargeOrderContract.GetTransaction()) { //status 0 订单生成 1 支付成功 2 支付失败 var res = _rechargeOrderContract.PaymentSuccess(transaction_id, 1, out_trade_no); if (res.ResultType == OperationResultType.Error) { a.Rollback(); } else { var b = _rechargeOrderContract.RechargeOrders.Where(x => x.order_Uid == out_trade_no) .Select(x => new MemberDepositDto() { MemberId = x.UserId, Price = x.RechargeType == 0 ? x.TureAmount : 0, Score = x.RechargeType == 1 ? x.TureAmount : 0, Cash = x.Amount, order_Uid = x.order_Uid, MemberDepositType = 2, MemberActivityType = x.RechargeType }).FirstOrDefault(); var updateMember = _memberdepositContract.InsertWx(b); if (updateMember.ResultType == OperationResultType.Error) { a.Rollback(); } else { //更新成功 a.Commit(); } } } } } else { resXml = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[支付失败]]></return_msg>" + "</xml> "; } } else { resXml = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[支付失败]]></return_msg>" + "</xml> "; //支付失败处理 if (out_trade_no != "") { var res = _rechargeOrderContract.PaymentSuccess(null, 2, out_trade_no); } } Response.Write(resXml); Response.End(); return(View()); }
/// <summary> /// 回调处理基类 /// 主要负责接收微信支付后台发送过来的数据,对数据进行签名验证 /// </summary> /// <param name="responseMessage"></param> /// <param name="request"></param> /// <param name="sceneryDomain"></param> public void Notify(HttpResponseMessage responseMessage, HttpRequest request) { ResultNotify notify = new ResultNotify(responseMessage, request); notify.ProcessNotify(); }
public ActionResult <string> GetResultNotify() { ResultNotify resultNotify = new ResultNotify(_httpContext); return(resultNotify.ProcessNotify()); }
// GET: /WeChat/WeChatPay/ResultNotifyPage/ public void ResultNotifyPage() { var redirectAction = ""; var res = new WxPayData <Qx.Account.Configs.Setting.WxPayConfig.Sports>(); var appid = RequstParam["appid"]; var attach = RequstParam["attach"]; var bank_type = RequstParam["bank_type"]; var cash_fee = RequstParam["cash_fee"]; var fee_type = RequstParam["fee_type"]; var is_subscribe = RequstParam["is_subscribe"]; var mch_id = RequstParam["mch_id"]; var nonce_str = RequstParam["nonce_str"]; var openid = RequstParam["openid"]; var out_trade_no = RequstParam["out_trade_no"]; var result_code = RequstParam["result_code"]; var return_code = RequstParam["return_code"]; var sign = RequstParam["sign"]; var time_end = RequstParam["time_end"]; var total_fee = RequstParam["total_fee"]; var transaction_id = RequstParam["transaction_id"]; //检查支付结果中transaction_id是否存在 if (transaction_id.HasValue() && out_trade_no.HasValue()) { //1.开始处理 var chargePayOrder = _accountPayService.FindPayOrder(out_trade_no); if (chargePayOrder != null) { chargePayOrder.ToNextState(transaction_id); _accountPayService.SyncPayOrder(chargePayOrder); if (result_code.ToUpper().Contains("SUCCESS") && return_code.ToUpper().Contains("SUCCESS") && chargePayOrder.IsValid(transaction_id)) { //防止重复处理 if (!chargePayOrder.IsEnd) { chargePayOrder.ToNextState(); //2.同步支付订单 _accountPayService.SyncPayOrder(chargePayOrder); //3.发送成功通知 //var url = "http://wx.52xyj.cn/WeChat/BookTiketWeb/MyWallet"; //var acc = _accountPayService.FindAccount(openid); //_wechatServices.Send_Charge_Ok_Msg(openid, url, // acc.Account.LastUpdateTime.ToStr(), // (int.Parse(total_fee)/100.0)+"元", // (acc.Account.Balance/100.0) + "元"); } res.SetValue("return_code", "SUCCESS"); res.SetValue("return_msg", "OK"); //Log.Info(this.GetType().ToString(), "order query success : " + res.ToXml()); redirectAction = "ChargeOK"; } else { // chargePayOrder.Failed(); // _accountPayService.SyncPayOrder(chargePayOrder); res.SetValue("return_code", "FAIL"); res.SetValue("return_msg", "订单查询失败"); // Log.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml()); redirectAction = "ChargeFailed"; } } } else { //若transaction_id不存在,则立即返回结果给微信支付后台 res.SetValue("return_code", "FAIL"); res.SetValue("return_msg", "支付结果中微信订单号不存在"); //Log.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml()); redirectAction = "ChargeFailed"; } // Response.Write(res.ToXml()); // Response.End(); var resultNotify = new ResultNotify <Qx.Account.Configs.Setting.WxPayConfig.Sports>(HttpContext); resultNotify.ProcessNotify(); // return RedirectToAction(redirectAction, "BookTiketWeb", new { transaction_id = transaction_id }); }
/// <summary> /// wx异步返回处理 /// </summary> /// <param name="context"></param> /// <returns></returns> public WxPayAPI.ResultNotify.WXPayBack WXJSApi_Notify(HttpContext context) { ResultNotify resultNotify = new ResultNotify(context); return(resultNotify.ProcessNotify()); }
/// <summary> /// 支付结果回调地址 /// </summary> /// <returns></returns> public void PayNotifyUrl() { ResultNotify resultNotify = new ResultNotify(); resultNotify.ProcessNotify(); }