Class: Stripe::CustomerTaxIdService

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

Defined Under Namespace

Classes: CreateParams, DeleteParams, 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

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

Creates a new tax_id object for a customer.



52
53
54
55
56
57
58
59
60
# File 'lib/stripe/services/customer_tax_id_service.rb', line 52

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.



63
64
65
66
67
68
69
70
71
# File 'lib/stripe/services/customer_tax_id_service.rb', line 63

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.



74
75
76
77
78
79
80
81
82
# File 'lib/stripe/services/customer_tax_id_service.rb', line 74

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.



85
86
87
88
89
90
91
92
93
# File 'lib/stripe/services/customer_tax_id_service.rb', line 85

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