예제 #1
0
        public SquareFactory(string applicationId, string applicationSecret)
        {
            Condition.Requires(applicationId, "applicationId").IsNotNullOrWhiteSpace();
            Condition.Requires(applicationSecret, "applicationSecret").IsNotNullOrWhiteSpace();

            _config = new SquareConfig(applicationId, applicationSecret);
        }
예제 #2
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;
        }
예제 #3
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);
        }
예제 #4
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
            };
        }
예제 #5
0
 public SquareAuthenticationService(SquareConfig config) : base(config)
 {
 }
예제 #6
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);
 }