예제 #1
0
        public async Task <MenuQueryResponse> GetMenu(int StoreID)
        {
            string requestURI = string.Format(URI.MenuQueryURI, StoreID, "en");

            var request = RestUtils.PackageRestRequest(requestURI, Method.GET);

            return(await RestUtils.SendRestRequest <MenuQueryResponse>(_client, request, log : LogError));
        }
예제 #2
0
        public async Task <LocationQueryResponse> SearchLocations(Address deliveryAddress)
        {
            string requestURI = string.Format(URI.LocationQueryURI, deliveryAddress.Street,
                                              deliveryAddress.City, deliveryAddress.State, deliveryAddress.PostalCode, "Delivery");

            var request = RestUtils.PackageRestRequest(requestURI, Method.GET);

            return(await RestUtils.SendRestRequest <LocationQueryResponse>(_client, request, log : LogError));
        }
예제 #3
0
        public async Task <OrderResponse> PriceOrder(Order order)
        {
            var request = RestUtils.PackageRestRequest(URI.PriceOrderURI, Method.POST,
                                                       new PriceOrderRequest(order), _orderHeaders);

            var response = await RestUtils.SendRestRequest <OrderResponse>(_client, request, log : LogError);

            ThrowOnInvalidDominosStatus(response);
            return(response);
        }
예제 #4
0
        public async Task <OrderResponse> PlaceOrder(Order order, List <Payment> payments, List <Coupon> coupons = null)
        {
            var requestBodyInnerObj = new OrderWithPayment(order, payments, coupons);

            var request = RestUtils.PackageRestRequest(URI.PlaceOrderURI, Method.POST,
                                                       new PlaceOrderRequest(requestBodyInnerObj), _orderHeaders);

            var response = await RestUtils.SendRestRequest <OrderResponse>(_client, request, log : LogError);

            ThrowOnInvalidDominosStatus(response);
            return(response);
        }
예제 #5
0
        public async Task <List <OrderStatus> > TrackOrder(string phoneNumber)
        {
            string requestURI = string.Format(URI.TrackingOrderURI, phoneNumber);

            var request = RestUtils.PackageRestRequest(requestURI, Method.GET);

            var resp = await RestUtils.SendRestRequest <SoapTrackingResponse>(
                _trackingClient, request, RestUtils.ResponseBodyType.XML, log : LogError);

            var status = resp.Envelope.Body.TrackingResponse.OrderStatuses.OrderStatus;

            return(new List <OrderStatus>(new OrderStatus[] { status }));
        }