Ejemplo n.º 1
0
        public BaseTest()
        {
            var config = this.LoadTestSettings <SquareCredentials>(@"\..\..\credentials.csv");

            this.Config      = new SquareConfig(config.ApplicationId, config.ApplicationSecret);
            this.Credentials = new SquareMerchantCredentials(config.AccessToken, config.RefreshToken);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        public SquareItemsService(SquareConfig config, SquareMerchantCredentials credentials, ISquareLocationsService locationsService) : base(config, credentials)
        {
            Condition.Requires(locationsService, "locationsService").IsNotNull();

            this._catalogApi       = new CatalogApi(base.ApiConfiguration);
            this._inventoryApi     = new InventoryApi(base.ApiConfiguration);
            this._locationsService = locationsService;
        }
Ejemplo n.º 4
0
        public SquareOrdersService(SquareConfig config, SquareMerchantCredentials credentials, ISquareLocationsService locationsService, ISquareItemsService itemsService) : base(config, credentials)
        {
            Condition.Requires(locationsService, "locationsService").IsNotNull();
            Condition.Requires(itemsService, "itemsService").IsNotNull();

            _locationsService = locationsService;
            _itemsService     = itemsService;
            _ordersApi        = new OrdersApi(base.ApiConfiguration);
        }
Ejemplo n.º 5
0
        public AuthorizedBaseService(SquareConfig config, SquareMerchantCredentials credentials) : base(config)
        {
            Condition.Requires(credentials, "credentials").IsNotNull();

            this.Credentials      = credentials;
            this.ApiConfiguration = new Square.Connect.Client.Configuration()
            {
                AccessToken = this.Credentials.AccessToken
            };
        }
Ejemplo n.º 6
0
 public ISquareItemsService CreateItemsService(SquareMerchantCredentials credentials)
 {
     return(new SquareItemsService(this._config, credentials, new SquareLocationsService(this._config, credentials)));
 }
Ejemplo n.º 7
0
 public SquareLocationsService(SquareConfig config, SquareMerchantCredentials credentials) : base(config, credentials)
 {
     _locationsApi = new LocationsApi(base.ApiConfiguration);
 }
 public SquareCustomersService(SquareConfig config, SquareMerchantCredentials credentials) : base(config, credentials)
 {
     _customersApi = new CustomersApi(base.ApiConfiguration);
 }