public string ToString(string key) { StringBuilderForXML sb = new StringBuilderForXML(); sb.Append("<xml>"); sb.Append("appid", appid); sb.Append("mch_id", mch_id); sb.Append("nonce_str", nonce_str); sb.Append("out_trade_no", out_trade_no); sb.Append("sign", getSign(key)); sb.Append("</xml>"); return(sb.ToString()); }
public string ToString(string key) { StringBuilderForXML sb = new StringBuilderForXML(); sb.Append("<xml>"); sb.Append("appid", appid); sb.Append("mch_id", mch_id); sb.Append("device_info", device_info); sb.Append("nonce_str", nonce_str); sb.Append("body", body); sb.Append("out_trade_no", out_trade_no); sb.Append("total_fee", total_fee.ToString()); sb.Append("spbill_create_ip", spbill_create_ip); sb.Append("auth_code", auth_code); sb.Append("sign", getSign(key)); sb.Append("</xml>"); return(sb.ToString()); }
public void ProcessRequest(HttpContext context) { try { IBLL.IPayNotify bll = new BLL.PayNotify(); string con = GetRequestText(context.Request); //LogHelper.writeLog("paynotify ->ProcessRequest()", con, null); ReadXML read = new ReadXML(con); if (read.Read("return_code") == "FAIL") { return; } string out_trade_no = read.Read("out_trade_no"); //商户订单号 string transaction_id = read.Read("transaction_id"); //微信交易号 //签名验证 // if (read.Read("result_code") == "FAIL") { bll.Fail(transaction_id, out_trade_no); } else { bll.Success(transaction_id, out_trade_no); } StringBuilderForXML sb = new StringBuilderForXML(); sb.Append("return_code", "SUCCESS"); sb.Append("return_msg", "OK"); Write(context, sb.ToString()); } catch (Exception e) { LogHelper.writeLog("paynotify ->ProcessRequest()", e.ToString(), null); //Write(e.Message); } }