Class: Square::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/square/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_url:, token: ENV.fetch("SQUARE_TOKEN", nil)) ⇒ Square::Client



6
7
8
9
10
11
12
13
14
15
# File 'lib/square/client.rb', line 6

def initialize(base_url:, token: ENV.fetch("SQUARE_TOKEN", nil))
  @raw_client = Square::Internal::Http::RawClient.new(
    base_url: base_url,
    headers: {
      "User-Agent": "square.rb/44.0.1.20250820",
      "X-Fern-Language": "Ruby",
      Authorization: "Bearer #{token}"
    }
  )
end

Instance Method Details

#apple_paySquare::ApplePay::Client



33
34
35
# File 'lib/square/client.rb', line 33

def apple_pay
  @apple_pay ||= Square::ApplePay::Client.new(client: @raw_client)
end

#bank_accountsSquare::BankAccounts::Client



38
39
40
# File 'lib/square/client.rb', line 38

def bank_accounts
  @bank_accounts ||= Square::BankAccounts::Client.new(client: @raw_client)
end

#bookingsSquare::Bookings::Client



43
44
45
# File 'lib/square/client.rb', line 43

def bookings
  @bookings ||= Square::Bookings::Client.new(client: @raw_client)
end

#cardsSquare::Cards::Client



48
49
50
# File 'lib/square/client.rb', line 48

def cards
  @cards ||= Square::Cards::Client.new(client: @raw_client)
end

#cash_drawersSquare::CashDrawers::Client



178
179
180
# File 'lib/square/client.rb', line 178

def cash_drawers
  @cash_drawers ||= Square::CashDrawers::Client.new(client: @raw_client)
end

#catalogSquare::Catalog::Client



53
54
55
# File 'lib/square/client.rb', line 53

def catalog
  @catalog ||= Square::Catalog::Client.new(client: @raw_client)
end

#checkoutSquare::Checkout::Client



118
119
120
# File 'lib/square/client.rb', line 118

def checkout
  @checkout ||= Square::Checkout::Client.new(client: @raw_client)
end

#customersSquare::Customers::Client



58
59
60
# File 'lib/square/client.rb', line 58

def customers
  @customers ||= Square::Customers::Client.new(client: @raw_client)
end

#devicesSquare::Devices::Client



63
64
65
# File 'lib/square/client.rb', line 63

def devices
  @devices ||= Square::Devices::Client.new(client: @raw_client)
end

#disputesSquare::Disputes::Client



68
69
70
# File 'lib/square/client.rb', line 68

def disputes
  @disputes ||= Square::Disputes::Client.new(client: @raw_client)
end

#employeesSquare::Employees::Client



73
74
75
# File 'lib/square/client.rb', line 73

def employees
  @employees ||= Square::Employees::Client.new(client: @raw_client)
end

#eventsSquare::Events::Client



78
79
80
# File 'lib/square/client.rb', line 78

def events
  @events ||= Square::Events::Client.new(client: @raw_client)
end

#gift_cardsSquare::GiftCards::Client



83
84
85
# File 'lib/square/client.rb', line 83

def gift_cards
  @gift_cards ||= Square::GiftCards::Client.new(client: @raw_client)
end

#inventorySquare::Inventory::Client



88
89
90
# File 'lib/square/client.rb', line 88

def inventory
  @inventory ||= Square::Inventory::Client.new(client: @raw_client)
end

#invoicesSquare::Invoices::Client



93
94
95
# File 'lib/square/client.rb', line 93

def invoices
  @invoices ||= Square::Invoices::Client.new(client: @raw_client)
end

#laborSquare::Labor::Client



98
99
100
# File 'lib/square/client.rb', line 98

def labor
  @labor ||= Square::Labor::Client.new(client: @raw_client)
end

#locationsSquare::Locations::Client



103
104
105
# File 'lib/square/client.rb', line 103

def locations
  @locations ||= Square::Locations::Client.new(client: @raw_client)
end

#loyaltySquare::Loyalty::Client



108
109
110
# File 'lib/square/client.rb', line 108

def loyalty
  @loyalty ||= Square::Loyalty::Client.new(client: @raw_client)
end

#merchantsSquare::Merchants::Client



113
114
115
# File 'lib/square/client.rb', line 113

def merchants
  @merchants ||= Square::Merchants::Client.new(client: @raw_client)
end

#mobileSquare::Mobile::Client



18
19
20
# File 'lib/square/client.rb', line 18

def mobile
  @mobile ||= Square::Mobile::Client.new(client: @raw_client)
end

#o_authSquare::OAuth::Client



23
24
25
# File 'lib/square/client.rb', line 23

def o_auth
  @o_auth ||= Square::OAuth::Client.new(client: @raw_client)
end

#ordersSquare::Orders::Client



123
124
125
# File 'lib/square/client.rb', line 123

def orders
  @orders ||= Square::Orders::Client.new(client: @raw_client)
end

#paymentsSquare::Payments::Client



128
129
130
# File 'lib/square/client.rb', line 128

def payments
  @payments ||= Square::Payments::Client.new(client: @raw_client)
end

#payoutsSquare::Payouts::Client



133
134
135
# File 'lib/square/client.rb', line 133

def payouts
  @payouts ||= Square::Payouts::Client.new(client: @raw_client)
end

#refundsSquare::Refunds::Client



138
139
140
# File 'lib/square/client.rb', line 138

def refunds
  @refunds ||= Square::Refunds::Client.new(client: @raw_client)
end

#sitesSquare::Sites::Client



143
144
145
# File 'lib/square/client.rb', line 143

def sites
  @sites ||= Square::Sites::Client.new(client: @raw_client)
end

#snippetsSquare::Snippets::Client



148
149
150
# File 'lib/square/client.rb', line 148

def snippets
  @snippets ||= Square::Snippets::Client.new(client: @raw_client)
end

#subscriptionsSquare::Subscriptions::Client



153
154
155
# File 'lib/square/client.rb', line 153

def subscriptions
  @subscriptions ||= Square::Subscriptions::Client.new(client: @raw_client)
end

#teamSquare::Team::Client



163
164
165
# File 'lib/square/client.rb', line 163

def team
  @team ||= Square::Team::Client.new(client: @raw_client)
end

#team_membersSquare::TeamMembers::Client



158
159
160
# File 'lib/square/client.rb', line 158

def team_members
  @team_members ||= Square::TeamMembers::Client.new(client: @raw_client)
end

#terminalSquare::Terminal::Client



168
169
170
# File 'lib/square/client.rb', line 168

def terminal
  @terminal ||= Square::Terminal::Client.new(client: @raw_client)
end

#v_1_transactionsSquare::V1Transactions::Client



28
29
30
# File 'lib/square/client.rb', line 28

def v_1_transactions
  @v_1_transactions ||= Square::V1Transactions::Client.new(client: @raw_client)
end

#vendorsSquare::Vendors::Client



173
174
175
# File 'lib/square/client.rb', line 173

def vendors
  @vendors ||= Square::Vendors::Client.new(client: @raw_client)
end

#webhooksSquare::Webhooks::Client



183
184
185
# File 'lib/square/client.rb', line 183

def webhooks
  @webhooks ||= Square::Webhooks::Client.new(client: @raw_client)
end