示例#1
0
 public WXConfigInfo(string app_id, string url, string js_api_ticket)
 {
     appId     = app_id;
     nonceStr  = WXUtil.getNonceStr();
     timestamp = DateTime.Now.toIntervalSince1970();
     signature = WXUtil.wxConfigSignature(nonceStr, timestamp, url, js_api_ticket);
 }
示例#2
0
        /// <summary>
        /// 获取当前提交的body内容
        /// </summary>
        /// <returns></returns>
        public string getContent(string app_id, string mch_id, string mch_secret)
        {
            var sd = new SortedDictionary <string, string>();

            sd["appid"]     = app_id;
            sd["mch_id"]    = mch_id;
            sd["nonce_str"] = WXUtil.getNonceStr();
            var fields = this.GetType().GetFields();

            foreach (FieldInfo fi in fields)
            {
                string value = fi.GetValue(this).ToString();
                if (value.isNull())
                {
                    continue;
                }
                sd[fi.Name] = value;
            }
            sd["sign"] = WXUtil.wxTradeSignature(sd, mch_secret);
            return(WXUtil.toXml(sd));
        }
示例#3
0
 public WXConfigInfo(string app_id)
 {
     appId     = app_id;
     nonceStr  = WXUtil.getNonceStr();
     timestamp = DateTime.Now.toIntervalSince1970();
 }