예제 #1
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        /// <summary>
        /// 获取团队信息
        /// </summary>
        public static KPZResult <object> GetTeamInfo(string teamToken)
        {
            object data = new object();
            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <object>(KPZApi._getTeamInfoApiUrl, param, "get"));
        }
예제 #2
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        /// <summary>
        /// 获取订单详情
        /// </summary>
        public static KPZResult <object> GetOrderLog(string orderid, string teamToken)
        {
            //string orderId = "18061516542500002";  // 生成一个第三方订单 ID
            object data = new { trade_no = orderid };
            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <object>(KPZApi._getOrderLogApiUrl, param, "get"));
        }
예제 #3
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        /// <summary>
        /// 获取配送员最新坐标
        /// </summary>
        public static KPZResult <object> GetCourierTag(string orderId, string teamToken)
        {
            //string orderId = "2654849875465125498";  // 生成一个第三方订单 ID
            object data = new { trade_no = orderId };
            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <object>(KPZApi._getCourierTagApiUrl, param, "get"));
        }
예제 #4
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        /// <summary>
        /// 取消订单
        /// </summary>
        public static KPZResult <object> CancelOrder(string orderId, string reason, string teamToken)
        {
            //string orderId = "18061516542500002";  // 生成一个第三方订单 ID
            object data = new { trade_no = orderId, reason };
            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <object>(KPZApi._cancelOrderApiUrl, param));
        }
예제 #5
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        /// <summary>
        /// 获取运费
        /// </summary>
        /// <param name="shopId">第三方商户ID</param>
        /// <param name="sendTag">送达坐标</param>
        /// <param name="getTag">取单坐标</param>
        /// <param name="orderPrice">第三方订单总价</param>
        /// <param name="payFee">第三方订单原配送费</param>
        public static KPZResult <KPZFee> GetFee(int shopId, string sendTag, string getTag, string orderPrice, string payFee, string teamToken)
        {
            KPZFee data = new KPZFee();

            data.shop_id      = shopId;     //1;
            data.customer_tag = sendTag;    //"23.15098980049273,113.3218529820442";
            data.get_tag      = getTag;     //"23.15098980049273,113.3218529820442";
            data.order_price  = orderPrice; //"1";
            data.pay_fee      = payFee;     //"1";
            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <KPZFee>(KPZApi._getFeeApiUrl, param, "get"));
        }
예제 #6
0
파일: KPZApi.cs 프로젝트: soon14/vzan
        public static string _getTeamInfoApiUrl   = "/open/team/getTeamInfo?";    //获取团队信息

        /// <summary>
        /// 生成订单
        /// </summary>
        public static KPZResult <OrderTradeNo> CreateOrder(KPZOrder data, string teamToken)
        {
            //log4net.LogHelper.WriteInfo(typeof(KPZApi),"快跑者订单:"+JsonConvert.SerializeObject(data));
            //string orderId = "2654849875465125499";  // 生成一个第三方订单 ID
            ////string preTime = DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH:mm:ss");   // 预计一个小时之后送达
            //string ordertime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            //KPZOrder data = new KPZOrder()
            //{
            //    shop_id = 1,
            //    shop_name = "小未商家",
            //    shop_tel = "18718463809",
            //    shop_address = "广东省天河区天河公园",
            //    shop_tag = "113.366326,23.128052",
            //    order_content = "2份烧白开(100x1),2份拉面(18x1)",
            //    order_note = "不要太辣了",
            //    //order_mark = "12",
            //    order_from = "小未科技",
            //    order_time = ordertime,
            //    //order_photo = "http://a4.att.hudong.com/38/47/19300001391844134804474917734_950.png",
            //    note = orderId,
            //    customer_name = "张三丰",
            //    customer_tel = "18288888888",
            //    customer_address = "广东省天河区天河公园",
            //    customer_tag = "113.366326,23.128052",
            //    order_no = orderId,
            //    order_price = 99.99f,
            //    order_origin_price = 100.00f,
            //    pay_status = 1,
            //    pay_fee = 1.66f,
            //    //pre_times = preTime,
            //};

            Dictionary <string, string> param = KPZApi.GetParamApi(data, teamToken);

            param["sign"] = KPZApi.GetSign(param, KPZApi._devSecret);

            return(KPZApi.KPZRequest <OrderTradeNo>(KPZApi._createOrderApiUrl, param));
        }