//获取签名 public string GetSign(string orderNo, string totalAmount, string buyerName, string buyerMobile) { DouShabaoConfig config = Config.Config.Instance.GetDouShabaoConfig(); string source = config.Source; string key = config.Key; var sign = "orderNo=" + orderNo + "&totalAmount=" + totalAmount + "&buyerName=" + buyerName + "&buyerMobile=" + buyerMobile + "&source=" + source + "&key=" + key; sign = Encrypt(sign).ToUpper(); //转大写 return(sign); }
public Resuldt DoushabaoRealize(string orderNo, string expressChannel, string totalAmount, string buyerName, string buyerMobile, string idCard, string expressNo, string transitLine, string orderTime, double totalWeight, string sign, string purchasOrderNo, string purchasOrderAmount, string purchasOrderTime, ProductList productlist) { DouShabaoConfig config = Config.Config.Instance.GetDouShabaoConfig(); string source = config.Source; string TotalWeight = totalWeight.ToString(); string url = config.ApiUrl; //ApiUrlTest测试路径,ApiUrl正式路径 string Productlist = "[{\"name\": \"" + productlist.ProductName + "\",\"category\": \"" + productlist.ProductCategory + "\",\"num\": " + productlist.ProductNum + ",\"price\": " + productlist.ProductPrice + ",\"brand\": \"" + productlist.ProductBrand + "\"}]"; string InsuranceProductList = "[{\"productId\": \"67\",\"insuranceAmount\": \"1000\",\"period\":\"60\",\"premium\": \"1\"}]"; //保险费暂定1元 67境内发货1000最高赔款金额 68国外发货400最高赔款金额 string data = "{\"orderNo\":\"" + orderNo + "\",\"expressChannel\":\"" + expressChannel + "\",\"totalAmount\":\"" + totalAmount + "\",\"buyerName\":\"" + buyerName + "\",\"buyerMobile\":\"" + buyerMobile + "\",\"idCard\": \"" + idCard + "\",\"expressNo\": \"" + expressNo + "\",\"transitLine\": \"EMS清关路线\",\"orderTime\": \"" + orderTime + "\",\"expressTime\": \"" + purchasOrderTime + "\",\"isReinforce\": false, \"prescription\": 1,\"totalWeight\": " + TotalWeight + ",\"source\": \"" + source + "\",\"sign\": \"" + sign + "\",\"purchasOrderNo\": \"" + purchasOrderNo + "\",\"shoppingSite\": \"信营\",\"purchasOrderAmount\": \"" + purchasOrderAmount + "\",\"destinationCity\": \"" + productlist.DestinationCity + "\",\"purchasOrderTime\": \"" + purchasOrderTime + "\",\"productList\":" + Productlist + ",\"insuranceProductList\":" + InsuranceProductList + ",\"purchasOrderNo\":\"" + purchasOrderNo + "\"}"; string retData = Post(url, data, sign); //接口处理 Log.LocalLogBo.Instance.WriteReturn("豆沙包数据:" + data + "/n处理结果:" + retData, "D:/Log/" + DateTime.Now + ""); //本地日志 return(null); }