Class: Stripe::Terminal::LocationService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/terminal/location_service.rb

Defined Under Namespace

Classes: CreateParams, DeleteParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#create(params = {}, opts = {}) ⇒ Object

Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](stripe.com/docs/terminal/fleet/locations) guide.



153
154
155
156
157
158
159
160
161
# File 'lib/stripe/services/terminal/location_service.rb', line 153

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/terminal/locations",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#delete(location, params = {}, opts = {}) ⇒ Object

Deletes a Location object.



164
165
166
167
168
169
170
171
172
# File 'lib/stripe/services/terminal/location_service.rb', line 164

def delete(location, params = {}, opts = {})
  request(
    method: :delete,
    path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#list(params = {}, opts = {}) ⇒ Object

Returns a list of Location objects.



175
176
177
178
179
180
181
182
183
# File 'lib/stripe/services/terminal/location_service.rb', line 175

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/terminal/locations",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(location, params = {}, opts = {}) ⇒ Object

Retrieves a Location object.



186
187
188
189
190
191
192
193
194
# File 'lib/stripe/services/terminal/location_service.rb', line 186

def retrieve(location, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#update(location, params = {}, opts = {}) ⇒ Object

Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



197
198
199
200
201
202
203
204
205
# File 'lib/stripe/services/terminal/location_service.rb', line 197

def update(location, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end