Class: FdxV660Api::Form1099K1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/form1099_k1.rb

Overview

Merchant Card and Third-Party Network Payments

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(tax_year: SKIP, corrected: SKIP, account_id: SKIP, tax_form_id: SKIP, tax_form_date: SKIP, additional_information: SKIP, tax_form_type: SKIP, issuer: SKIP, recipient: SKIP, attributes: SKIP, error: SKIP, links: SKIP, payment_settlement_entity: SKIP, electronic_payment_facilitator: SKIP, payment_card: SKIP, third_party_network: SKIP, pse_name: SKIP, pse_phone: SKIP, account_number: SKIP, gross_amount: SKIP, card_not_present: SKIP, tips: SKIP, occupation_codes: SKIP, merchant_category_code: SKIP, number_of_transactions: SKIP, federal_tax_withheld: SKIP, month_amounts: SKIP, state_and_local: SKIP, second_tin_notice: SKIP, additional_properties: nil) ⇒ Form1099K1

Returns a new instance of Form1099K1.



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 218

def initialize(tax_year: SKIP, corrected: SKIP, account_id: SKIP,
               tax_form_id: SKIP, tax_form_date: SKIP,
               additional_information: SKIP, tax_form_type: SKIP,
               issuer: SKIP, recipient: SKIP, attributes: SKIP, error: SKIP,
               links: SKIP, payment_settlement_entity: SKIP,
               electronic_payment_facilitator: SKIP, payment_card: SKIP,
               third_party_network: SKIP, pse_name: SKIP, pse_phone: SKIP,
               account_number: SKIP, gross_amount: SKIP,
               card_not_present: SKIP, tips: SKIP, occupation_codes: SKIP,
               merchant_category_code: SKIP, number_of_transactions: SKIP,
               federal_tax_withheld: SKIP, month_amounts: SKIP,
               state_and_local: SKIP, second_tin_notice: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @tax_year = tax_year unless tax_year == SKIP
  @corrected = corrected unless corrected == SKIP
  @account_id =  unless  == SKIP
  @tax_form_id = tax_form_id unless tax_form_id == SKIP
  @tax_form_date = tax_form_date unless tax_form_date == SKIP
  @additional_information = additional_information unless additional_information == SKIP
  @tax_form_type = tax_form_type unless tax_form_type == SKIP
  @issuer = issuer unless issuer == SKIP
  @recipient = recipient unless recipient == SKIP
  @attributes = attributes unless attributes == SKIP
  @error = error unless error == SKIP
  @links = links unless links == SKIP
  unless payment_settlement_entity == SKIP
    @payment_settlement_entity =
      payment_settlement_entity
  end
  unless electronic_payment_facilitator == SKIP
    @electronic_payment_facilitator =
      electronic_payment_facilitator
  end
  @payment_card = payment_card unless payment_card == SKIP
  @third_party_network = third_party_network unless third_party_network == SKIP
  @pse_name = pse_name unless pse_name == SKIP
  @pse_phone = pse_phone unless pse_phone == SKIP
  @account_number =  unless  == SKIP
  @gross_amount = gross_amount unless gross_amount == SKIP
  @card_not_present = card_not_present unless card_not_present == SKIP
  @tips = tips unless tips == SKIP
  @occupation_codes = occupation_codes unless occupation_codes == SKIP
  @merchant_category_code = merchant_category_code unless merchant_category_code == SKIP
  @number_of_transactions = number_of_transactions unless number_of_transactions == SKIP
  @federal_tax_withheld = federal_tax_withheld unless federal_tax_withheld == SKIP
  @month_amounts = month_amounts unless month_amounts == SKIP
  @state_and_local = state_and_local unless state_and_local == SKIP
  @second_tin_notice = second_tin_notice unless second_tin_notice == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

Long-term persistent identity of the source account. Not the account number

Returns:

  • (String)


23
24
25
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 23

def 
  @account_id
end

#account_numberString

Account number

Returns:

  • (String)


100
101
102
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 100

def 
  @account_number
end

#additional_informationString

Additional explanation text or content about this tax form

Returns:

  • (String)


37
38
39
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 37

def additional_information
  @additional_information
end

#attributesArray[TaxFormAttribute]

Additional attributes for this tax form when defined fields are not available. Some specific additional attributes already defined by providers: Fields required by [IRS FIRE](https://www.irs.gov/e-file-providers/filing-information-returns-elec tronically-fire): Name Control, Type of Identification Number (EIN, SSN, ITIN, ATIN). (ATIN is tax ID number for pending adoptions.) Tax form provider field for taxpayer notification: Recipient Email Address.

Returns:



63
64
65
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 63

def attributes
  @attributes
end

#card_not_presentFloat

Box 1b, Card Not Present Transactions

Returns:

  • (Float)


108
109
110
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 108

def card_not_present
  @card_not_present
end

#correctedTrueClass | FalseClass

True to indicate this is a corrected tax form

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 18

def corrected
  @corrected
end

#electronic_payment_facilitatorTrueClass | FalseClass

Check to indicate if FILER is an Electronic Payment Facilitator (EPF) / Other third party

Returns:

  • (TrueClass | FalseClass)


80
81
82
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 80

def electronic_payment_facilitator
  @electronic_payment_facilitator
end

#errorError2

Present if an error was encountered while retrieving this form

Returns:



67
68
69
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 67

def error
  @error
end

#federal_tax_withheldFloat

Box 4, Federal income tax withheld

Returns:

  • (Float)


128
129
130
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 128

def federal_tax_withheld
  @federal_tax_withheld
end

#gross_amountFloat

Box 1a, Gross amount of payment card/third party network transactions

Returns:

  • (Float)


104
105
106
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 104

def gross_amount
  @gross_amount
end

#issuerTaxParty8

Issuer's name, address, phone, and TIN. Issuer data need only be transmitted on enclosing TaxStatement, if it is the same on all its included tax forms.

Returns:



47
48
49
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 47

def issuer
  @issuer
end

Links to retrieve this form as data or image, or to invoke other APIs

Returns:



71
72
73
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 71

def links
  @links
end

#merchant_category_codeString

Box 2, Merchant category code

Returns:

  • (String)


120
121
122
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 120

def merchant_category_code
  @merchant_category_code
end

#month_amountsArray[MonthAndAmount]

Box 5, Monthly amounts

Returns:



132
133
134
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 132

def month_amounts
  @month_amounts
end

#number_of_transactionsFloat

Box 3, Number of payment transactions

Returns:

  • (Float)


124
125
126
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 124

def number_of_transactions
  @number_of_transactions
end

#occupation_codesArray[String]

Box 1d, Treasury Tipped Occupation Codes (TTOC)

Returns:

  • (Array[String])


116
117
118
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 116

def occupation_codes
  @occupation_codes
end

#payment_cardTrueClass | FalseClass

Check to indicate transactions reported are: Payment card

Returns:

  • (TrueClass | FalseClass)


84
85
86
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 84

def payment_card
  @payment_card
end

#payment_settlement_entityTrueClass | FalseClass

Check to indicate if FILER is a Payment Settlement Entity (PSE)

Returns:

  • (TrueClass | FalseClass)


75
76
77
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 75

def payment_settlement_entity
  @payment_settlement_entity
end

#pse_nameString

PSE's name

Returns:

  • (String)


92
93
94
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 92

def pse_name
  @pse_name
end

#pse_phoneTelephoneNumberPlusExtension3

PSE's phone number



96
97
98
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 96

def pse_phone
  @pse_phone
end

#recipientTaxParty1

Recipient's name, address, phone, and TIN. Recipient data need only be transmitted on enclosing TaxStatement, if it is the same on all its included tax forms.

Returns:



53
54
55
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 53

def recipient
  @recipient
end

#second_tin_noticeTrueClass | FalseClass

Second TIN Notice

Returns:

  • (TrueClass | FalseClass)


140
141
142
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 140

def second_tin_notice
  @second_tin_notice
end

#state_and_localArray[StateAndLocalTaxWithholding]

Boxes 6-8, State and Local tax withholding

Returns:



136
137
138
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 136

def state_and_local
  @state_and_local
end

#tax_form_dateDate

Date of production or delivery of the tax form

Returns:

  • (Date)


33
34
35
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 33

def tax_form_date
  @tax_form_date
end

#tax_form_idString

Long-term persistent id for this tax form. Depending upon the data provider, this may be the same id as the enclosing tax statement id, or this may be a different id, or this id may be omitted.

Returns:

  • (String)


29
30
31
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 29

def tax_form_id
  @tax_form_id
end

#tax_form_typeTypeFormType1

Enumerated name of the tax form entity e.g. "TaxW2"

Returns:



41
42
43
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 41

def tax_form_type
  @tax_form_type
end

#tax_yearInteger

Year for which taxes are being paid

Returns:

  • (Integer)


14
15
16
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 14

def tax_year
  @tax_year
end

#third_party_networkTrueClass | FalseClass

Check to indicate transactions reported are: Third party network

Returns:

  • (TrueClass | FalseClass)


88
89
90
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 88

def third_party_network
  @third_party_network
end

#tipsFloat

Box 1c, Cash tips

Returns:

  • (Float)


112
113
114
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 112

def tips
  @tips
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 273

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  tax_year = hash.key?('taxYear') ? hash['taxYear'] : SKIP
  corrected = hash.key?('corrected') ? hash['corrected'] : SKIP
   = hash.key?('accountId') ? hash['accountId'] : SKIP
  tax_form_id = hash.key?('taxFormId') ? hash['taxFormId'] : SKIP
  tax_form_date = hash.key?('taxFormDate') ? hash['taxFormDate'] : SKIP
  additional_information =
    hash.key?('additionalInformation') ? hash['additionalInformation'] : SKIP
  tax_form_type = hash.key?('taxFormType') ? hash['taxFormType'] : SKIP
  issuer = TaxParty8.from_hash(hash['issuer']) if hash['issuer']
  recipient = TaxParty1.from_hash(hash['recipient']) if hash['recipient']
  # Parameter is an array, so we need to iterate through it
  attributes = nil
  unless hash['attributes'].nil?
    attributes = []
    hash['attributes'].each do |structure|
      attributes << (TaxFormAttribute.from_hash(structure) if structure)
    end
  end

  attributes = SKIP unless hash.key?('attributes')
  error = Error2.from_hash(hash['error']) if hash['error']
  # Parameter is an array, so we need to iterate through it
  links = nil
  unless hash['links'].nil?
    links = []
    hash['links'].each do |structure|
      links << (HateoasLink.from_hash(structure) if structure)
    end
  end

  links = SKIP unless hash.key?('links')
  payment_settlement_entity =
    hash.key?('paymentSettlementEntity') ? hash['paymentSettlementEntity'] : SKIP
  electronic_payment_facilitator =
    hash.key?('electronicPaymentFacilitator') ? hash['electronicPaymentFacilitator'] : SKIP
  payment_card = hash.key?('paymentCard') ? hash['paymentCard'] : SKIP
  third_party_network =
    hash.key?('thirdPartyNetwork') ? hash['thirdPartyNetwork'] : SKIP
  pse_name = hash.key?('pseName') ? hash['pseName'] : SKIP
  pse_phone = TelephoneNumberPlusExtension3.from_hash(hash['psePhone']) if hash['psePhone']
   = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP
  gross_amount = hash.key?('grossAmount') ? hash['grossAmount'] : SKIP
  card_not_present =
    hash.key?('cardNotPresent') ? hash['cardNotPresent'] : SKIP
  tips = hash.key?('tips') ? hash['tips'] : SKIP
  occupation_codes =
    hash.key?('occupationCodes') ? hash['occupationCodes'] : SKIP
  merchant_category_code =
    hash.key?('merchantCategoryCode') ? hash['merchantCategoryCode'] : SKIP
  number_of_transactions =
    hash.key?('numberOfTransactions') ? hash['numberOfTransactions'] : SKIP
  federal_tax_withheld =
    hash.key?('federalTaxWithheld') ? hash['federalTaxWithheld'] : SKIP
  # Parameter is an array, so we need to iterate through it
  month_amounts = nil
  unless hash['monthAmounts'].nil?
    month_amounts = []
    hash['monthAmounts'].each do |structure|
      month_amounts << (MonthAndAmount.from_hash(structure) if structure)
    end
  end

  month_amounts = SKIP unless hash.key?('monthAmounts')
  # Parameter is an array, so we need to iterate through it
  state_and_local = nil
  unless hash['stateAndLocal'].nil?
    state_and_local = []
    hash['stateAndLocal'].each do |structure|
      state_and_local << (StateAndLocalTaxWithholding.from_hash(structure) if structure)
    end
  end

  state_and_local = SKIP unless hash.key?('stateAndLocal')
  second_tin_notice =
    hash.key?('secondTinNotice') ? hash['secondTinNotice'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  Form1099K1.new(tax_year: tax_year,
                 corrected: corrected,
                 account_id: ,
                 tax_form_id: tax_form_id,
                 tax_form_date: tax_form_date,
                 additional_information: additional_information,
                 tax_form_type: tax_form_type,
                 issuer: issuer,
                 recipient: recipient,
                 attributes: attributes,
                 error: error,
                 links: links,
                 payment_settlement_entity: payment_settlement_entity,
                 electronic_payment_facilitator: electronic_payment_facilitator,
                 payment_card: payment_card,
                 third_party_network: third_party_network,
                 pse_name: pse_name,
                 pse_phone: pse_phone,
                 account_number: ,
                 gross_amount: gross_amount,
                 card_not_present: card_not_present,
                 tips: tips,
                 occupation_codes: occupation_codes,
                 merchant_category_code: merchant_category_code,
                 number_of_transactions: number_of_transactions,
                 federal_tax_withheld: federal_tax_withheld,
                 month_amounts: month_amounts,
                 state_and_local: state_and_local,
                 second_tin_notice: second_tin_notice,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 143

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['tax_year'] = 'taxYear'
  @_hash['corrected'] = 'corrected'
  @_hash['account_id'] = 'accountId'
  @_hash['tax_form_id'] = 'taxFormId'
  @_hash['tax_form_date'] = 'taxFormDate'
  @_hash['additional_information'] = 'additionalInformation'
  @_hash['tax_form_type'] = 'taxFormType'
  @_hash['issuer'] = 'issuer'
  @_hash['recipient'] = 'recipient'
  @_hash['attributes'] = 'attributes'
  @_hash['error'] = 'error'
  @_hash['links'] = 'links'
  @_hash['payment_settlement_entity'] = 'paymentSettlementEntity'
  @_hash['electronic_payment_facilitator'] =
    'electronicPaymentFacilitator'
  @_hash['payment_card'] = 'paymentCard'
  @_hash['third_party_network'] = 'thirdPartyNetwork'
  @_hash['pse_name'] = 'pseName'
  @_hash['pse_phone'] = 'psePhone'
  @_hash['account_number'] = 'accountNumber'
  @_hash['gross_amount'] = 'grossAmount'
  @_hash['card_not_present'] = 'cardNotPresent'
  @_hash['tips'] = 'tips'
  @_hash['occupation_codes'] = 'occupationCodes'
  @_hash['merchant_category_code'] = 'merchantCategoryCode'
  @_hash['number_of_transactions'] = 'numberOfTransactions'
  @_hash['federal_tax_withheld'] = 'federalTaxWithheld'
  @_hash['month_amounts'] = 'monthAmounts'
  @_hash['state_and_local'] = 'stateAndLocal'
  @_hash['second_tin_notice'] = 'secondTinNotice'
  @_hash
end

.nullablesObject

An array for nullable fields



214
215
216
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 214

def self.nullables
  []
end

.optionalsObject

An array for optional fields



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 179

def self.optionals
  %w[
    tax_year
    corrected
    account_id
    tax_form_id
    tax_form_date
    additional_information
    tax_form_type
    issuer
    recipient
    attributes
    error
    links
    payment_settlement_entity
    electronic_payment_facilitator
    payment_card
    third_party_network
    pse_name
    pse_phone
    account_number
    gross_amount
    card_not_present
    tips
    occupation_codes
    merchant_category_code
    number_of_transactions
    federal_tax_withheld
    month_amounts
    state_and_local
    second_tin_notice
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 413

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} tax_year: #{@tax_year.inspect}, corrected: #{@corrected.inspect},"\
  " account_id: #{@account_id.inspect}, tax_form_id: #{@tax_form_id.inspect}, tax_form_date:"\
  " #{@tax_form_date.inspect}, additional_information: #{@additional_information.inspect},"\
  " tax_form_type: #{@tax_form_type.inspect}, issuer: #{@issuer.inspect}, recipient:"\
  " #{@recipient.inspect}, attributes: #{@attributes.inspect}, error: #{@error.inspect},"\
  " links: #{@links.inspect}, payment_settlement_entity:"\
  " #{@payment_settlement_entity.inspect}, electronic_payment_facilitator:"\
  " #{@electronic_payment_facilitator.inspect}, payment_card: #{@payment_card.inspect},"\
  " third_party_network: #{@third_party_network.inspect}, pse_name: #{@pse_name.inspect},"\
  " pse_phone: #{@pse_phone.inspect}, account_number: #{@account_number.inspect},"\
  " gross_amount: #{@gross_amount.inspect}, card_not_present: #{@card_not_present.inspect},"\
  " tips: #{@tips.inspect}, occupation_codes: #{@occupation_codes.inspect},"\
  " merchant_category_code: #{@merchant_category_code.inspect}, number_of_transactions:"\
  " #{@number_of_transactions.inspect}, federal_tax_withheld:"\
  " #{@federal_tax_withheld.inspect}, month_amounts: #{@month_amounts.inspect},"\
  " state_and_local: #{@state_and_local.inspect}, second_tin_notice:"\
  " #{@second_tin_notice.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/fdx_v660_api/models/form1099_k1.rb', line 394

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} tax_year: #{@tax_year}, corrected: #{@corrected}, account_id:"\
  " #{@account_id}, tax_form_id: #{@tax_form_id}, tax_form_date: #{@tax_form_date},"\
  " additional_information: #{@additional_information}, tax_form_type: #{@tax_form_type},"\
  " issuer: #{@issuer}, recipient: #{@recipient}, attributes: #{@attributes}, error:"\
  " #{@error}, links: #{@links}, payment_settlement_entity: #{@payment_settlement_entity},"\
  " electronic_payment_facilitator: #{@electronic_payment_facilitator}, payment_card:"\
  " #{@payment_card}, third_party_network: #{@third_party_network}, pse_name: #{@pse_name},"\
  " pse_phone: #{@pse_phone}, account_number: #{@account_number}, gross_amount:"\
  " #{@gross_amount}, card_not_present: #{@card_not_present}, tips: #{@tips},"\
  " occupation_codes: #{@occupation_codes}, merchant_category_code:"\
  " #{@merchant_category_code}, number_of_transactions: #{@number_of_transactions},"\
  " federal_tax_withheld: #{@federal_tax_withheld}, month_amounts: #{@month_amounts},"\
  " state_and_local: #{@state_and_local}, second_tin_notice: #{@second_tin_notice},"\
  " additional_properties: #{@additional_properties}>"
end