class Square::Client

square client class.

Attributes

config[R]

Public Class Methods

new(connection: nil, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put], environment: 'production', custom_url: 'https://connect.squareup.com', square_version: '2022-04-20', access_token: '', user_agent_detail: '', additional_headers: {}, config: nil) click to toggle source
# File lib/square/client.rb, line 228
def initialize(connection: nil, timeout: 60, max_retries: 0,
               retry_interval: 1, backoff_factor: 2,
               retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
               retry_methods: %i[get put], environment: 'production',
               custom_url: 'https://connect.squareup.com',
               square_version: '2022-04-20', access_token: '',
               user_agent_detail: '', additional_headers: {}, config: nil)
  @config = if config.nil?
              Configuration.new(connection: connection, timeout: timeout,
                                max_retries: max_retries,
                                retry_interval: retry_interval,
                                backoff_factor: backoff_factor,
                                retry_statuses: retry_statuses,
                                retry_methods: retry_methods,
                                environment: environment,
                                custom_url: custom_url,
                                square_version: square_version,
                                access_token: access_token,
                                user_agent_detail: user_agent_detail,
                                additional_headers: additional_headers)
            else
              config
            end
end

Public Instance Methods

apple_pay() click to toggle source

Access to apple_pay controller. @return [ApplePayApi] Returns the controller instance.

# File lib/square/client.rb, line 38
def apple_pay
  @apple_pay ||= ApplePayApi.new config
end
bank_accounts() click to toggle source

Access to bank_accounts controller. @return [BankAccountsApi] Returns the controller instance.

# File lib/square/client.rb, line 44
def bank_accounts
  @bank_accounts ||= BankAccountsApi.new config
end
bookings() click to toggle source

Access to bookings controller. @return [BookingsApi] Returns the controller instance.

# File lib/square/client.rb, line 50
def bookings
  @bookings ||= BookingsApi.new config
end
cards() click to toggle source

Access to cards controller. @return [CardsApi] Returns the controller instance.

# File lib/square/client.rb, line 56
def cards
  @cards ||= CardsApi.new config
end
cash_drawers() click to toggle source

Access to cash_drawers controller. @return [CashDrawersApi] Returns the controller instance.

# File lib/square/client.rb, line 62
def cash_drawers
  @cash_drawers ||= CashDrawersApi.new config
end
catalog() click to toggle source

Access to catalog controller. @return [CatalogApi] Returns the controller instance.

# File lib/square/client.rb, line 68
def catalog
  @catalog ||= CatalogApi.new config
end
checkout() click to toggle source

Access to checkout controller. @return [CheckoutApi] Returns the controller instance.

# File lib/square/client.rb, line 146
def checkout
  @checkout ||= CheckoutApi.new config
end
customer_groups() click to toggle source

Access to customer_groups controller. @return [CustomerGroupsApi] Returns the controller instance.

# File lib/square/client.rb, line 80
def customer_groups
  @customer_groups ||= CustomerGroupsApi.new config
end
customer_segments() click to toggle source

Access to customer_segments controller. @return [CustomerSegmentsApi] Returns the controller instance.

# File lib/square/client.rb, line 86
def customer_segments
  @customer_segments ||= CustomerSegmentsApi.new config
end
customers() click to toggle source

Access to customers controller. @return [CustomersApi] Returns the controller instance.

# File lib/square/client.rb, line 74
def customers
  @customers ||= CustomersApi.new config
end
devices() click to toggle source

Access to devices controller. @return [DevicesApi] Returns the controller instance.

# File lib/square/client.rb, line 92
def devices
  @devices ||= DevicesApi.new config
end
disputes() click to toggle source

Access to disputes controller. @return [DisputesApi] Returns the controller instance.

# File lib/square/client.rb, line 98
def disputes
  @disputes ||= DisputesApi.new config
end
employees() click to toggle source

Access to employees controller. @return [EmployeesApi] Returns the controller instance.

# File lib/square/client.rb, line 104
def employees
  @employees ||= EmployeesApi.new config
end
gift_card_activities() click to toggle source

Access to gift_card_activities controller. @return [GiftCardActivitiesApi] Returns the controller instance.

# File lib/square/client.rb, line 116
def gift_card_activities
  @gift_card_activities ||= GiftCardActivitiesApi.new config
end
gift_cards() click to toggle source

Access to gift_cards controller. @return [GiftCardsApi] Returns the controller instance.

# File lib/square/client.rb, line 110
def gift_cards
  @gift_cards ||= GiftCardsApi.new config
end
inventory() click to toggle source

Access to inventory controller. @return [InventoryApi] Returns the controller instance.

# File lib/square/client.rb, line 122
def inventory
  @inventory ||= InventoryApi.new config
end
invoices() click to toggle source

Access to invoices controller. @return [InvoicesApi] Returns the controller instance.

# File lib/square/client.rb, line 128
def invoices
  @invoices ||= InvoicesApi.new config
end
labor() click to toggle source

Access to labor controller. @return [LaborApi] Returns the controller instance.

# File lib/square/client.rb, line 134
def labor
  @labor ||= LaborApi.new config
end
locations() click to toggle source

Access to locations controller. @return [LocationsApi] Returns the controller instance.

# File lib/square/client.rb, line 140
def locations
  @locations ||= LocationsApi.new config
end
loyalty() click to toggle source

Access to loyalty controller. @return [LoyaltyApi] Returns the controller instance.

# File lib/square/client.rb, line 158
def loyalty
  @loyalty ||= LoyaltyApi.new config
end
merchants() click to toggle source

Access to merchants controller. @return [MerchantsApi] Returns the controller instance.

# File lib/square/client.rb, line 164
def merchants
  @merchants ||= MerchantsApi.new config
end
mobile_authorization() click to toggle source

Access to mobile_authorization controller. @return [MobileAuthorizationApi] Returns the controller instance.

# File lib/square/client.rb, line 20
def mobile_authorization
  @mobile_authorization ||= MobileAuthorizationApi.new config
end
o_auth() click to toggle source

Access to o_auth controller. @return [OAuthApi] Returns the controller instance.

# File lib/square/client.rb, line 26
def o_auth
  @o_auth ||= OAuthApi.new config
end
orders() click to toggle source

Access to orders controller. @return [OrdersApi] Returns the controller instance.

# File lib/square/client.rb, line 170
def orders
  @orders ||= OrdersApi.new config
end
payments() click to toggle source

Access to payments controller. @return [PaymentsApi] Returns the controller instance.

# File lib/square/client.rb, line 176
def payments
  @payments ||= PaymentsApi.new config
end
payouts() click to toggle source

Access to payouts controller. @return [PayoutsApi] Returns the controller instance.

# File lib/square/client.rb, line 182
def payouts
  @payouts ||= PayoutsApi.new config
end
refunds() click to toggle source

Access to refunds controller. @return [RefundsApi] Returns the controller instance.

# File lib/square/client.rb, line 188
def refunds
  @refunds ||= RefundsApi.new config
end
sdk_version() click to toggle source
# File lib/square/client.rb, line 6
def sdk_version
  '19.0.0.20220420'
end
sites() click to toggle source

Access to sites controller. @return [SitesApi] Returns the controller instance.

# File lib/square/client.rb, line 194
def sites
  @sites ||= SitesApi.new config
end
snippets() click to toggle source

Access to snippets controller. @return [SnippetsApi] Returns the controller instance.

# File lib/square/client.rb, line 200
def snippets
  @snippets ||= SnippetsApi.new config
end
square_version() click to toggle source
# File lib/square/client.rb, line 10
def square_version
  config.square_version
end
subscriptions() click to toggle source

Access to subscriptions controller. @return [SubscriptionsApi] Returns the controller instance.

# File lib/square/client.rb, line 206
def subscriptions
  @subscriptions ||= SubscriptionsApi.new config
end
team() click to toggle source

Access to team controller. @return [TeamApi] Returns the controller instance.

# File lib/square/client.rb, line 212
def team
  @team ||= TeamApi.new config
end
terminal() click to toggle source

Access to terminal controller. @return [TerminalApi] Returns the controller instance.

# File lib/square/client.rb, line 218
def terminal
  @terminal ||= TerminalApi.new config
end
transactions() click to toggle source

Access to transactions controller. @return [TransactionsApi] Returns the controller instance.

# File lib/square/client.rb, line 152
def transactions
  @transactions ||= TransactionsApi.new config
end
user_agent_detail() click to toggle source
# File lib/square/client.rb, line 14
def user_agent_detail
  config.user_agent_detail
end
v1_transactions() click to toggle source

Access to v1_transactions controller. @return [V1TransactionsApi] Returns the controller instance.

# File lib/square/client.rb, line 32
def v1_transactions
  @v1_transactions ||= V1TransactionsApi.new config
end
vendors() click to toggle source

Access to vendors controller. @return [VendorsApi] Returns the controller instance.

# File lib/square/client.rb, line 224
def vendors
  @vendors ||= VendorsApi.new config
end