示例#1
0
        public string OperateCallBaceResult(object requestParameters, string operateUrl, bool error)
        {
            try
            {
                string body      = Newtonsoft.Json.JsonConvert.SerializeObject(requestParameters);
                string timestamp = OperateUtil.GetTimeStamp().ToString();
                string nonce     = OperateUtil.GetNonceString(8);
                String sign      = SignUtil.sign(this.merchantKey, timestamp, nonce, body);
                Dictionary <string, string> map = new Dictionary <string, string>();
                if (error)
                {
                    sign = "12312312qwed";
                }
                map.Add("body", body);
                map.Add("sign", sign);
                map.Add("timestamp", timestamp);
                map.Add("nonce", nonce);

                Dictionary <string, string> Spaheader    = new Dictionary <string, string>();
                Dictionary <string, string> myParameters = new Dictionary <string, string>();
                HttpProvider httpProvider = new HttpProvider();

                HttpResponseParameter reponseParameter = httpProvider.Excute(new HttpRequestParameter
                {
                    Url              = operateUrl,
                    IsPost           = true,
                    Encoding         = Encoding.UTF8,
                    Parameters       = map,
                    HeaderParameters = map,
                }, "", "");

                string textReg = reponseParameter.Body;
                return(textReg);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }