Exemple #1
0
        /// <summary>
        /// Đặt bàn trước
        /// </summary>
        /// <param name="ipostSettings"></param>
        /// <param name="token"></param>
        /// <param name="errors"></param>
        /// <returns></returns>
        public static booking_online_response BookingOnline(IPOSTSettings ipostSettings,
                                                            booking_online_request order_online_request,
                                                            out string errors)
        {
            var url        = string.Format("{0}/partner/booking_online", GetBaseUrl(ipostSettings.ApiUrl));
            var parameters = new Dictionary <string, string>();


            parameters.Add(ipost_parameters.pos_id, order_online_request.Pos_id);
            parameters.Add(ipost_parameters.booking_info, JsonSerialize.SerializeObject(order_online_request.Booking_info));
            if (order_online_request.Order_online != null)
            {
                parameters.Add(ipost_parameters.orders, JsonSerialize.SerializeObject(order_online_request.Order_online));
            }

            return(Post <booking_online_response>(url, parameters, ipostSettings.Access_token, ipostSettings.User_token, out errors));
        }
Exemple #2
0
        /// <summary>
        /// Gọi đồ online
        /// </summary>
        /// <param name="ipostSettings"></param>
        /// <param name="errors"></param>
        /// <returns></returns>
        public static order_online_response OrderOnline(IPOSTSettings ipostSettings,
                                                        order_online_request order_online_request,
                                                        out string errors)
        {
            var url        = string.Format("{0}/partner/order_online", GetBaseUrl(ipostSettings.ApiUrl));
            var parameters = new Dictionary <string, string>();

            parameters.Add(ipost_parameters.pos_parent, order_online_request.Pos_parent);
            parameters.Add(ipost_parameters.pos_id, order_online_request.Pos_id);
            parameters.Add("full_address", order_online_request.Full_address);
            parameters.Add("note", order_online_request.Note);
            parameters.Add("longitude", order_online_request.Longitude.ToString());
            parameters.Add("latitude", order_online_request.Latitude.ToString());
            parameters.Add("payment_method", order_online_request.Payment_method);

            parameters.Add(ipost_parameters.booking_info, JsonSerialize.SerializeObject(order_online_request.Booking_info));
            parameters.Add(ipost_parameters.orders, JsonSerialize.SerializeObject(order_online_request.Order_online));

            return(Post <order_online_response>(url, parameters, ipostSettings.Access_token, ipostSettings.User_token, out errors));
        }