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, NzMrdp, Payee, 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

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #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



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

def au_serr
  @au_serr
end

#ca_mrdpObject (readonly)

Attribute for field ca_mrdp



183
184
185
# File 'lib/stripe/resources/tax/form.rb', line 183

def ca_mrdp
  @ca_mrdp
end

#corrected_byObject (readonly)

The form that corrects this form, if any.



185
186
187
# File 'lib/stripe/resources/tax/form.rb', line 185

def corrected_by
  @corrected_by
end

#createdObject (readonly)

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



187
188
189
# File 'lib/stripe/resources/tax/form.rb', line 187

def created
  @created
end

#eu_dac7Object (readonly)

Attribute for field eu_dac7



189
190
191
# File 'lib/stripe/resources/tax/form.rb', line 189

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.



191
192
193
# File 'lib/stripe/resources/tax/form.rb', line 191

def filing_statuses
  @filing_statuses
end

#gb_mrdpObject (readonly)

Attribute for field gb_mrdp



193
194
195
# File 'lib/stripe/resources/tax/form.rb', line 193

def gb_mrdp
  @gb_mrdp
end

#idObject (readonly)

Unique identifier for the object.



195
196
197
# File 'lib/stripe/resources/tax/form.rb', line 195

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



197
198
199
# File 'lib/stripe/resources/tax/form.rb', line 197

def livemode
  @livemode
end

#nz_mrdpObject (readonly)

Attribute for field nz_mrdp



199
200
201
# File 'lib/stripe/resources/tax/form.rb', line 199

def nz_mrdp
  @nz_mrdp
end

#objectObject (readonly)

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



201
202
203
# File 'lib/stripe/resources/tax/form.rb', line 201

def object
  @object
end

#payeeObject (readonly)

Attribute for field payee



203
204
205
# File 'lib/stripe/resources/tax/form.rb', line 203

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.



205
206
207
# File 'lib/stripe/resources/tax/form.rb', line 205

def type
  @type
end

#us_1099_kObject (readonly)

Attribute for field us_1099_k



207
208
209
# File 'lib/stripe/resources/tax/form.rb', line 207

def us_1099_k
  @us_1099_k
end

#us_1099_miscObject (readonly)

Attribute for field us_1099_misc



209
210
211
# File 'lib/stripe/resources/tax/form.rb', line 209

def us_1099_misc
  @us_1099_misc
end

#us_1099_necObject (readonly)

Attribute for field us_1099_nec



211
212
213
# File 'lib/stripe/resources/tax/form.rb', line 211

def us_1099_nec
  @us_1099_nec
end

Class Method Details

.field_remappingsObject



259
260
261
# File 'lib/stripe/resources/tax/form.rb', line 259

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/stripe/resources/tax/form.rb', line 244

def self.inner_class_types
  @inner_class_types = {
    au_serr: AuSerr,
    ca_mrdp: CaMrdp,
    eu_dac7: EuDac7,
    filing_statuses: FilingStatus,
    gb_mrdp: GbMrdp,
    nz_mrdp: NzMrdp,
    payee: Payee,
    us_1099_k: Us1099K,
    us_1099_misc: Us1099Misc,
    us_1099_nec: Us1099Nec,
  }
end

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



214
215
216
# File 'lib/stripe/resources/tax/form.rb', line 214

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.



232
233
234
235
236
237
238
239
240
241
242
# File 'lib/stripe/resources/tax/form.rb', line 232

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.



219
220
221
222
223
224
225
226
227
228
229
# File 'lib/stripe/resources/tax/form.rb', line 219

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