/// <summary> /// 获取prepay_id /// </summary> public string GetPrepayId(WxUnifiedOrder order, string key) { string prepay_id = ""; string post_data = GetUnifiedOrderXml(order, key); string request_data = PostXmlToUrl(WxpayConfig.UnifiedPayUrl, post_data); SortedDictionary <string, string> requestXML = GetInfoFromXml(request_data); foreach (KeyValuePair <string, string> k in requestXML) { if (k.Key == "prepay_id") { prepay_id = k.Value; break; } } return(prepay_id); }
/// <summary> /// 微信统一下单接口xml参数整理 /// </summary> /// <param name="order">微信支付参数实例</param> /// <param name="key">密钥</param> public static string GetUnifiedOrderXml(WxUnifiedOrder order, string key) { return(WxpayCore.GetUnifiedOrderXml(order, key)); }