Class: Stripe::Tax::FormService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/tax/form_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

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

Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.



8
9
10
# File 'lib/stripe/services/tax/form_service.rb', line 8

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

#pdf(id, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object

Download the PDF for a tax form.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/stripe/services/tax/form_service.rb', line 13

def pdf(id, params = {}, opts = {}, &read_body_chunk_block)
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
  request_stream(
    method: :get,
    path: format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :files,
    &read_body_chunk_block
  )
end

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

Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information.



26
27
28
29
30
31
32
33
34
# File 'lib/stripe/services/tax/form_service.rb', line 26

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