Пример #1
0
        /// <summary>
        /// 更新卡券。
        /// </summary>
        /// <param name="cardId">卡券Id。</param>
        /// <param name="model">卡券更新模型。</param>
        /// <returns>此次更新是否需要审核。</returns>
        public bool Update(string cardId, CardUpdateModel model)
        {
            var url = "https://api.weixin.qq.com/card/update?access_token=" + _accountModel.GetAccessToken();
            var obj = new JObject();

            obj["card_id"]     = cardId;
            obj["member_card"] = JObject.Parse(JsonConvert.SerializeObject(model));

            var content = WeiXinHttpHelper.PostString(url, Encoding.UTF8.GetBytes(obj.ToString()));

            return(JObject.Parse(content).Value <bool>("send_check"));
        }
Пример #2
0
        /// <summary>
        /// 更新卡券。
        /// </summary>
        /// <param name="cardId">卡券Id。</param>
        /// <param name="model">卡券更新模型。</param>
        /// <returns>此次更新是否需要审核。</returns>
        public bool Update(string cardId, CardUpdateModel model)
        {
            var url = "https://api.weixin.qq.com/card/update?access_token=" + _accountModel.GetAccessToken();
            var obj = new JObject();

            obj["card_id"] = cardId;
            obj["member_card"] = JObject.Parse(JsonConvert.SerializeObject(model));

            var content = WeiXinHttpHelper.PostString(url, Encoding.UTF8.GetBytes(obj.ToString()));
            return JObject.Parse(content).Value<bool>("send_check");
        }