BeeCloud.BCPay.deletePlan C# (CSharp) Метод

deletePlan() публичный статический Метод

删除订阅计划
public static deletePlan ( string id ) : string
id string
Результат string
        public static string deletePlan(string id)
        {
            long timestamp = BCUtil.GetTimeStamp(DateTime.Now);

            string planURL = BCPrivateUtil.getHost() + BCConstants.version + BCConstants.bcplanURL + "/" + id;
            planURL += "?app_id=" + BCCache.Instance.appId + "&app_sign=" + BCPrivateUtil.getAppSignature(BCCache.Instance.appId, BCCache.Instance.appSecret, timestamp.ToString()) + "&timestamp=" + timestamp;

            try
            {
                HttpWebResponse response = BCPrivateUtil.CreateDeleteHttpResponse(planURL, BCCache.Instance.networkTimeout);

                string respString = BCPrivateUtil.GetResponseString(response);

                JsonData responseData = JsonMapper.ToObject(respString);

                if (responseData["result_code"].ToString() == "0")
                {
                    return id;
                }
                else
                {
                    var ex = new BCException(responseData["err_detail"].ToString());
                    throw ex;
                }
            }
            catch (Exception e)
            {
                var ex = new BCException(e.Message);
                throw ex;
            }
        }