Class: Stripe::TaxRateService

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

Defined Under Namespace

Classes: CreateParams, 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 tax rate.



189
190
191
# File 'lib/stripe/services/tax_rate_service.rb', line 189

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

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

Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.



194
195
196
# File 'lib/stripe/services/tax_rate_service.rb', line 194

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

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

Retrieves a tax rate with the given ID



199
200
201
202
203
204
205
206
207
# File 'lib/stripe/services/tax_rate_service.rb', line 199

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

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

Updates an existing tax rate.



210
211
212
213
214
215
216
217
218
# File 'lib/stripe/services/tax_rate_service.rb', line 210

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