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.
71 72 73 |
# File 'lib/stripe/services/tax/form_service.rb', line 71 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.
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/stripe/services/tax/form_service.rb', line 76 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.
89 90 91 92 93 94 95 96 97 |
# File 'lib/stripe/services/tax/form_service.rb', line 89 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 |