Class: Stripe::Tax::LocationService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Tax::LocationService
- Defined in:
- lib/stripe/services/tax/location_service.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Create a tax location to use in calculating taxes for a service, ticket, or other type of product.
-
#list(params = {}, opts = {}) ⇒ Object
Retrieve a list of all tax locations.
-
#retrieve(location, params = {}, opts = {}) ⇒ Object
Fetch the details of a specific tax location using its unique identifier.
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
Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location.
8 9 10 11 12 13 14 15 16 |
# File 'lib/stripe/services/tax/location_service.rb', line 8 def create(params = {}, opts = {}) request( method: :post, path: "/v1/tax/locations", params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types.
The response includes detailed information for each tax location, such as its address, name, description, and current operational status.
You can paginate through the list by using the limit parameter to control the number of results returned in each request.
23 24 25 26 27 28 29 30 31 |
# File 'lib/stripe/services/tax/location_service.rb', line 23 def list(params = {}, opts = {}) request( method: :get, path: "/v1/tax/locations", params: params, opts: opts, base_address: :api ) end |
#retrieve(location, params = {}, opts = {}) ⇒ Object
Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](docs.stripe.com/tax/tax-for-tickets/integration-guide).
34 35 36 37 38 39 40 41 42 |
# File 'lib/stripe/services/tax/location_service.rb', line 34 def retrieve(location, params = {}, opts = {}) request( method: :get, path: format("/v1/tax/locations/%<location>s", { location: CGI.escape(location) }), params: params, opts: opts, base_address: :api ) end |