Class: Stripe::Terminal::LocationService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Terminal::LocationService
- Defined in:
- lib/stripe/services/terminal/location_service.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Creates a new Location object.
-
#delete(location, params = {}, opts = {}) ⇒ Object
Deletes a Location object.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of Location objects.
-
#retrieve(location, params = {}, opts = {}) ⇒ Object
Retrieves a Location object.
-
#update(location, params = {}, opts = {}) ⇒ Object
Updates a Location object by setting the values of the parameters passed.
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.
9 10 11 12 13 14 15 16 17 |
# File 'lib/stripe/services/terminal/location_service.rb', line 9 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.
20 21 22 23 24 25 26 27 28 |
# File 'lib/stripe/services/terminal/location_service.rb', line 20 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.
31 32 33 34 35 36 37 38 39 |
# File 'lib/stripe/services/terminal/location_service.rb', line 31 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.
42 43 44 45 46 47 48 49 50 |
# File 'lib/stripe/services/terminal/location_service.rb', line 42 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.
53 54 55 56 57 58 59 60 61 |
# File 'lib/stripe/services/terminal/location_service.rb', line 53 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 |