コード例 #1
0
        private static string DadaAPI(long shopId, string body, string url, string source_id = "")
        {
            var    dadaconfig = CityExpressConfigApplication.GetDaDaCityExpressConfig(shopId);
            string appkey     = dadaconfig.app_key;
            string appsecret  = dadaconfig.app_secret;

            source_id = string.IsNullOrWhiteSpace(source_id) ? dadaconfig.source_id : source_id;
            if (!url.Contains("imdada.cn") && source_id == "73753")
            {
                url = "http://newopen.qa.imdada.cn" + url;
            }
            if (!url.Contains("imdada.cn"))
            {
                url = "http://newopen.imdada.cn" + url;
            }
            SortedDictionary <string, string> tparams = new SortedDictionary <string, string>();

            tparams.Add("app_key", appkey);
            tparams.Add("body", body);
            tparams.Add("format", "json");
            tparams.Add("source_id", source_id);
            tparams.Add("timestamp", DateTimeToUnixTimestamp(DateTime.Now).ToString());
            tparams.Add("v", "1.0");

            string sign = Sign(appsecret, tparams);

            tparams.Add("signature", sign);
            string strJsonParams = JsonConvert.SerializeObject(tparams);

            string result = GetResponseResult(url, strJsonParams);

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// 商家投诉达达
        /// </summary>
        /// <param name="source_id">商户编号</param>
        /// <param name="order_id">第三方订单编号</param>
        /// <param name="reason_id">投诉原因ID</param>
        /// <returns>{"status": "success","code": 0,"msg": "成功"}</returns>
        public static string complaintDada(long shopId, string order_id, int reason_id)
        {
            var    dadaconfig = CityExpressConfigApplication.GetDaDaCityExpressConfig(shopId);
            string appkey     = dadaconfig.app_key;
            string appsecret  = dadaconfig.app_secret;
            string source_id  = dadaconfig.source_id;
            SortedDictionary <string, object> tparams = new SortedDictionary <string, object>();

            tparams.Add("source_id", source_id);
            tparams.Add("order_id", order_id);
            tparams.Add("reason_id", reason_id);
            string body = JsonConvert.SerializeObject(tparams);
            string url  = "/api/complaint/dada";

            return(DadaAPI(shopId, body, url));
        }