Class: Stripe::CustomerTaxIdService

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

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(customer, params = {}, opts = {}) ⇒ Object

Creates a new tax_id object for a customer.



7
8
9
10
11
12
13
14
15
# File 'lib/stripe/services/customer_tax_id_service.rb', line 7

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

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

Deletes an existing tax_id object.



18
19
20
21
22
23
24
25
26
# File 'lib/stripe/services/customer_tax_id_service.rb', line 18

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

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

Returns a list of tax IDs for a customer.



29
30
31
32
33
34
35
36
37
# File 'lib/stripe/services/customer_tax_id_service.rb', line 29

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

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

Retrieves the tax_id object with the given identifier.



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

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