/// <summary> /// 添加邮费模板 /// </summary> /// <param name="delivery_template"></param> /// <param name="appId"></param> /// <param name="appSecret"></param> /// <returns></returns> public static AddDeliveryTemplateResult AddDeliveryTemplate(DeliveryTemplate delivery_template, string appId, string appSecret) { var url = "https://api.weixin.qq.com/merchant/express/add?access_token="; var access_token = WeiXin.GetAccessToken(appId, appSecret); url = url + access_token; var json = Util.HttpPost2(url, Util.ToJson(new { delivery_template = delivery_template })); return Util.JsonTo<AddDeliveryTemplateResult>(json); }
/// <summary> /// 删除邮费模板 /// </summary> /// <param name="delivery_template"></param> /// <returns></returns> public static ReturnCode UpdateDeliveryTemplate(DeliveryTemplate delivery_template) { WeiXin.CheckGlobalCredential(); return UpdateDeliveryTemplate(delivery_template, WeiXin.AppID, WeiXin.AppSecret); }
/// <summary> /// 删除邮费模板 /// </summary> /// <param name="delivery_template"></param> /// <param name="appId"></param> /// <param name="appSecret"></param> /// <returns></returns> public static ReturnCode UpdateDeliveryTemplate(DeliveryTemplate delivery_template, string appId, string appSecret) { var template_id = delivery_template.Id; var url = "https://api.weixin.qq.com/merchant/express/update?access_token="; var access_token = WeiXin.GetAccessToken(appId, appSecret); url = url + access_token; var json = Util.HttpPost2(url, Util.ToJson(new { template_id = template_id, delivery_template = delivery_template })); return Util.JsonTo<ReturnCode>(json); }
/// <summary> /// 添加邮费模板 /// </summary> /// <param name="delivery_template"></param> /// <returns></returns> public static AddDeliveryTemplateResult AddDeliveryTemplate(DeliveryTemplate delivery_template) { WeiXin.CheckGlobalCredential(); return AddDeliveryTemplate(delivery_template, WeiXin.AppID, WeiXin.AppSecret); }