public ISquareOrdersService CreateOrdersService(SquareMerchantCredentials credentials) { var locationsService = new SquareLocationsService(this._config, credentials); var itemsService = new SquareItemsService(this._config, credentials, locationsService); return(new SquareOrdersService(this._config, credentials, locationsService, itemsService)); }
public void Init() { var locationsService = new SquareLocationsService(this.Config, this.Credentials); this._itemsService = new SquareItemsService(this.Config, this.Credentials, locationsService); var locations = locationsService.GetActiveLocationsAsync(CancellationToken.None, null).Result; this._defaultLocationId = locations.OrderBy(l => l.Name).First().Id; }