Class: Stripe::TaxCodeService

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

Defined Under Namespace

Classes: ListParams, RetrieveParams

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

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

A list of [all tax codes available](stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations.



34
35
36
# File 'lib/stripe/services/tax_code_service.rb', line 34

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

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

Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information.



39
40
41
42
43
44
45
46
47
# File 'lib/stripe/services/tax_code_service.rb', line 39

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