Class: Stripe::Tax::Form

Inherits:
APIResource show all
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)

Defined Under Namespace

Classes: AuSerr, CaMrdp, EuDac7, FilingStatus, GbMrdp, ListParams, NzMrdp, Payee, PdfParams, Us1099K, Us1099Misc, Us1099Nec

Constant Summary collapse

OBJECT_NAME =
"tax.form"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

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

included

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

Instance Attribute Details

#au_serrObject (readonly)

Attribute for field au_serr



147
148
149
# File 'lib/stripe/resources/tax/form.rb', line 147

def au_serr
  @au_serr
end

#ca_mrdpObject (readonly)

Attribute for field ca_mrdp



149
150
151
# File 'lib/stripe/resources/tax/form.rb', line 149

def ca_mrdp
  @ca_mrdp
end

#corrected_byObject (readonly)

The form that corrects this form, if any.



151
152
153
# File 'lib/stripe/resources/tax/form.rb', line 151

def corrected_by
  @corrected_by
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



153
154
155
# File 'lib/stripe/resources/tax/form.rb', line 153

def created
  @created
end

#eu_dac7Object (readonly)

Attribute for field eu_dac7



155
156
157
# File 'lib/stripe/resources/tax/form.rb', line 155

def eu_dac7
  @eu_dac7
end

#filing_statusesObject (readonly)

A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction’s tax authority.



157
158
159
# File 'lib/stripe/resources/tax/form.rb', line 157

def filing_statuses
  @filing_statuses
end

#gb_mrdpObject (readonly)

Attribute for field gb_mrdp



159
160
161
# File 'lib/stripe/resources/tax/form.rb', line 159

def gb_mrdp
  @gb_mrdp
end

#idObject (readonly)

Unique identifier for the object.



161
162
163
# File 'lib/stripe/resources/tax/form.rb', line 161

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



163
164
165
# File 'lib/stripe/resources/tax/form.rb', line 163

def livemode
  @livemode
end

#nz_mrdpObject (readonly)

Attribute for field nz_mrdp



165
166
167
# File 'lib/stripe/resources/tax/form.rb', line 165

def nz_mrdp
  @nz_mrdp
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



167
168
169
# File 'lib/stripe/resources/tax/form.rb', line 167

def object
  @object
end

#payeeObject (readonly)

Attribute for field payee



169
170
171
# File 'lib/stripe/resources/tax/form.rb', line 169

def payee
  @payee
end

#typeObject (readonly)

The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.



171
172
173
# File 'lib/stripe/resources/tax/form.rb', line 171

def type
  @type
end

#us_1099_kObject (readonly)

Attribute for field us_1099_k



173
174
175
# File 'lib/stripe/resources/tax/form.rb', line 173

def us_1099_k
  @us_1099_k
end

#us_1099_miscObject (readonly)

Attribute for field us_1099_misc



175
176
177
# File 'lib/stripe/resources/tax/form.rb', line 175

def us_1099_misc
  @us_1099_misc
end

#us_1099_necObject (readonly)

Attribute for field us_1099_nec



177
178
179
# File 'lib/stripe/resources/tax/form.rb', line 177

def us_1099_nec
  @us_1099_nec
end

Class 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.



180
181
182
# File 'lib/stripe/resources/tax/form.rb', line 180

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/tax/forms", params: params, opts: opts)
end

.object_nameObject



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.



198
199
200
201
202
203
204
205
206
207
208
# File 'lib/stripe/resources/tax/form.rb', line 198

def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
  execute_resource_request_stream(
    :get,
    format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }),
    :files,
    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.



185
186
187
188
189
190
191
192
193
194
195
# File 'lib/stripe/resources/tax/form.rb', line 185

def pdf(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(self["id"]) }),
    params: params,
    opts: opts,
    base_address: :files,
    &read_body_chunk_block
  )
end