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.



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

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.



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

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.



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

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.



207
208
209
210
211
212
213
214
215
# File 'lib/stripe/services/terminal/location_service.rb', line 207

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.



218
219
220
221
222
223
224
225
226
# File 'lib/stripe/services/terminal/location_service.rb', line 218

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