Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Dictionary <string, string> parametersAll = bllPay.GetRequestParameter();
         XmlDocument xmlDoc = new XmlDocument();
         xmlDoc.LoadXml(parametersAll["notify_data"]);
         xmlDoc.Save(string.Format("C:\\Alipay\\mallnotify{0}.xml", DateTime.Now.ToString("yyyyMMddHHmmssfff")));
         //商户订单号
         string outTradeNo = xmlDoc.SelectSingleNode("/notify/out_trade_no").InnerText;
         //支付宝交易号
         string tradeNo = xmlDoc.SelectSingleNode("/notify/trade_no").InnerText;
         //交易状态
         string tradeStatus = xmlDoc.SelectSingleNode("/notify/trade_status").InnerText;
         string baseUrl     = HttpContext.Current.Request.Url.Authority;
         string msg         = "";
         bool   payResult   = bllPay.AliPayMallNotify(tradeStatus, tradeNo, outTradeNo, parametersAll, baseUrl, out msg);
         if (payResult)
         {
             Response.Write(successStr);
         }
         else
         {
             //Tolog(msg);
             Response.Write(failStr);
         }
     }
     catch (Exception)
     {
         Response.Write("fail");
     }
 }