public bool IsOrdersReceived() { try { var response = this._client.ListOrders( this._request ); if( !response.IsSetListOrdersResult() ) return false; if( !response.ListOrdersResult.IsSetOrders() ) return true; var orders = response.ListOrdersResult.Orders.Select( o => new ComposedOrder( o ) ).ToList(); foreach( var order in orders.Take( 5 ) ) { var itemsService = new OrderItemsService( this._client, new ListOrderItemsRequest { AmazonOrderId = order.AmazonOrder.AmazonOrderId, SellerId = this._request.SellerId, MWSAuthToken = this._request.MWSAuthToken }, this._orderItemsThrottler ); if( !itemsService.IsOrderItemsReceived() ) return false; } return true; } catch( Exception ) { return false; } }
private IEnumerable<OrderItem> GetOrderItems( string orderId ) { var itemsService = new OrderItemsService( this._client, new ListOrderItemsRequest { AmazonOrderId = orderId, SellerId = this._request.SellerId, MWSAuthToken = this._request.MWSAuthToken }, _orderItemsThrottler ); return itemsService.LoadOrderItems(); }