Class: Stripe::Tax::FormService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Tax::FormService
- Defined in:
- lib/stripe/services/tax/form_service.rb
Defined Under Namespace
Classes: ListParams, PdfParams, RetrieveParams
Instance Method Summary collapse
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of tax forms which were previously created.
-
#pdf(id, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a tax form.
-
#retrieve(id, params = {}, opts = {}) ⇒ Object
Retrieves the details of a tax form that has previously been created.
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.
78 79 80 |
# File 'lib/stripe/services/tax/form_service.rb', line 78 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.
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/stripe/services/tax/form_service.rb', line 83 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.
96 97 98 99 100 101 102 103 104 |
# File 'lib/stripe/services/tax/form_service.rb', line 96 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 |