示例#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);
        }
示例#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));
        }
示例#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;
        }
示例#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);
        }
示例#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
            };
        }
示例#6
0
 public ISquareItemsService CreateItemsService(SquareMerchantCredentials credentials)
 {
     return(new SquareItemsService(this._config, credentials, new SquareLocationsService(this._config, credentials)));
 }
示例#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);
 }