예제 #1
0
        public ServiceAmountInfo GetOrderServiceAmount(string token, string orderId)
        {
            var postDict = new SortedDictionary <string, object>();

            postDict["appAuthToken"] = token;
            postDict["charset"]      = "utf-8";
            postDict["timestamp"]    = (Helper.ConvertDateTimeInt(DateTime.Now)).ToString();
            postDict["orderId"]      = orderId;
            postDict["sign"]         = MeituanHelper.Sign(postDict, this.Config.SignKey);

            StringBuilder url = new StringBuilder("http://api.open.cater.meituan.com/waimai/order/queryById?");

            foreach (var item in postDict)
            {
                url.Append(item.Key);
                url.Append('=');
                url.Append(item.Value);
                url.Append('&');
            }

            var result = Helper.GetQueryString(url.ToString(), 8000);

            var jsonObj          = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
            var poiReceiveDetail = jsonObj["data"].Value <string>("poiReceiveDetail");

            jsonObj = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(poiReceiveDetail);
            var info = new ServiceAmountInfo();

            info.PlatformServiceAmount = jsonObj.Value <double>("foodShareFeeChargeByPoi") / 100;
            info.SettleAmount          = jsonObj.Value <double>("wmPoiReceiveCent") / 100;

            return(info);
        }
예제 #2
0
 public void OnReceiveOrderSettlement(ResturantPlatformType platformType, string orderId, ServiceAmountInfo serviceAmountInfo)
 {
 }
예제 #3
0
 public void OnReceiveOrderSettlement(ResturantPlatformType platformType, string orderId, ServiceAmountInfo settleAmount)
 {
     throw new NotImplementedException();
 }