Class: Stripe::TaxRateService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::TaxRateService
- Defined in:
- lib/stripe/services/tax_rate_service.rb
Defined Under Namespace
Classes: CreateParams, ListParams, RetrieveParams, UpdateParams
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
Creates a new tax rate.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of your tax rates.
-
#retrieve(tax_rate, params = {}, opts = {}) ⇒ Object
Retrieves a tax rate with the given ID.
-
#update(tax_rate, params = {}, opts = {}) ⇒ Object
Updates an existing tax rate.
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.
162 163 164 |
# File 'lib/stripe/services/tax_rate_service.rb', line 162 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.
167 168 169 |
# File 'lib/stripe/services/tax_rate_service.rb', line 167 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
172 173 174 175 176 177 178 179 180 |
# File 'lib/stripe/services/tax_rate_service.rb', line 172 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.
183 184 185 186 187 188 189 190 191 |
# File 'lib/stripe/services/tax_rate_service.rb', line 183 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 |