Class: Stripe::Tax::Form
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Tax::Form
- Extended by:
- APIOperations::List
- Defined in:
- lib/stripe/resources/tax/form.rb
Overview
Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
Related guide: [US tax reporting for Connect platforms](stripe.com/docs/connect/tax-reporting)
Constant Summary collapse
- OBJECT_NAME =
"tax.form"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.list(filters = {}, opts = {}) ⇒ Object
Returns a list of tax forms which were previously created.
- .object_name ⇒ Object
-
.pdf(id, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a tax form.
Instance Method Summary collapse
-
#pdf(params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a tax form.
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Class Method Details
.list(filters = {}, 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.
18 19 20 |
# File 'lib/stripe/resources/tax/form.rb', line 18 def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/tax/forms", params: filters, opts: opts) end |
.object_name ⇒ Object
13 14 15 |
# File 'lib/stripe/resources/tax/form.rb', line 13 def self.object_name "tax.form" end |
.pdf(id, params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a tax form.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/stripe/resources/tax/form.rb', line 36 def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block) config = opts[:client]&.config || Stripe.config opts = { api_base: config.uploads_base }.merge(opts) execute_resource_request_stream( :get, format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }), params, opts, &read_body_chunk_block ) end |
Instance Method Details
#pdf(params = {}, opts = {}, &read_body_chunk_block) ⇒ Object
Download the PDF for a tax form.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stripe/resources/tax/form.rb', line 23 def pdf(params = {}, opts = {}, &read_body_chunk_block) config = opts[:client]&.config || Stripe.config opts = { api_base: config.uploads_base }.merge(opts) request_stream( method: :get, path: format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(self["id"]) }), params: params, opts: opts, &read_body_chunk_block ) end |