public void ConfirmOrder(ConfirmOrderParameter parameter) { var param = new Dictionary <string, object>(); param["orderId"] = parameter.OrderID; var jsonObj = Post(parameter.Token, "eleme.order.confirmOrderLite", param); }
public void ConfirmOrder(ConfirmOrderParameter parameter) { Post("order.confirm", new Dictionary <string, object>() { { "order_id", parameter.OrderID } }); }
public void OnReceiveNewOrder(ResturantPlatformType platformType, OrderInfo orderInfo) { using (Way.Lib.CLog log = new Way.Lib.CLog("新订单")) { log.LogJson(orderInfo); } var resturant = ResturantFactory.CreateResturant(platformType); //取消订单 //resturant.CancelOrder(new CancelOrderParameter() { // OrderID = orderInfo.ThirdOrderId, // Reason = CancelOrderReason.Busy, // Token = StoreInfos[orderInfo.ErpStoreID.Value] //}); //确认订单 ConfirmOrderParameter parameter = new ConfirmOrderParameter(); parameter.OrderID = orderInfo.ThirdOrderId; parameter.Token = "f8b8211858f6307d24b97e67aa3915e3e5aa78d0dbc7765618fb8485901db153"; resturant.ConfirmOrder(parameter); return; //发起配送 resturant.Delivering(new DeliverParameter() { CourierName = "刘培松", CourierPhone = "13261952754", OrderID = orderInfo.ThirdOrderId, Token = StoreInfos[orderInfo.ErpStoreID.Value], }); resturant.Delivered(new DeliveredParameter() { OrderID = orderInfo.ThirdOrderId, Token = StoreInfos[orderInfo.ErpStoreID.Value], }); }
public void ConfirmOrder(ConfirmOrderParameter parameter) { var postDict = new SortedDictionary <string, object>(); postDict["appAuthToken"] = parameter.Token; postDict["charset"] = "utf-8"; postDict["timestamp"] = (Helper.ConvertDateTimeInt(DateTime.Now)).ToString(); postDict["orderId"] = parameter.OrderID; postDict["sign"] = MeituanHelper.Sign(postDict, this.Config.SignKey); var result = Helper.PostQueryString("http://api.open.cater.meituan.com/waimai/order/confirm", postDict, 8000); var jsonObj = (Newtonsoft.Json.Linq.JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result); Newtonsoft.Json.Linq.JToken errobj; if (jsonObj.TryGetValue("error", StringComparison.CurrentCultureIgnoreCase, out errobj)) { throw new Exception(errobj.Value <string>("message")); } if (!string.Equals(jsonObj.Value <string>("data"), "ok", StringComparison.CurrentCultureIgnoreCase)) { throw new Exception("发生错误"); } }