Class: ThePlaidApi::StudentLoan

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/student_loan.rb

Overview

Contains details about a student loan account

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(account_id:, account_number:, disbursement_dates:, expected_payoff_date:, guarantor:, interest_rate_percentage:, is_overdue:, last_payment_amount:, last_payment_date:, last_statement_issue_date:, loan_name:, loan_status:, minimum_payment_amount:, next_payment_due_date:, origination_date:, origination_principal_amount:, outstanding_interest_amount:, payment_reference_number:, pslf_status:, repayment_plan:, sequence_number:, servicer_address:, ytd_interest_paid:, ytd_principal_paid:, last_statement_balance: SKIP, additional_properties: nil) ⇒ StudentLoan

Returns a new instance of StudentLoan.



212
213
214
215
216
217
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
# File 'lib/the_plaid_api/models/student_loan.rb', line 212

def initialize(account_id:, account_number:, disbursement_dates:,
               expected_payoff_date:, guarantor:, interest_rate_percentage:,
               is_overdue:, last_payment_amount:, last_payment_date:,
               last_statement_issue_date:, loan_name:, loan_status:,
               minimum_payment_amount:, next_payment_due_date:,
               origination_date:, origination_principal_amount:,
               outstanding_interest_amount:, payment_reference_number:,
               pslf_status:, repayment_plan:, sequence_number:,
               servicer_address:, ytd_interest_paid:, ytd_principal_paid:,
               last_statement_balance: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id = 
  @account_number = 
  @disbursement_dates = disbursement_dates
  @expected_payoff_date = expected_payoff_date
  @guarantor = guarantor
  @interest_rate_percentage = interest_rate_percentage
  @is_overdue = is_overdue
  @last_payment_amount = last_payment_amount
  @last_payment_date = last_payment_date
  @last_statement_balance = last_statement_balance unless last_statement_balance == SKIP
  @last_statement_issue_date = last_statement_issue_date
  @loan_name = loan_name
  @loan_status = loan_status
  @minimum_payment_amount = minimum_payment_amount
  @next_payment_due_date = next_payment_due_date
  @origination_date = origination_date
  @origination_principal_amount = origination_principal_amount
  @outstanding_interest_amount = outstanding_interest_amount
  @payment_reference_number = payment_reference_number
  @pslf_status = pslf_status
  @repayment_plan = repayment_plan
  @sequence_number = sequence_number
  @servicer_address = servicer_address
  @ytd_interest_paid = ytd_interest_paid
  @ytd_principal_paid = ytd_principal_paid
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

The ID of the account that this liability belongs to. Each account can only contain one liability.

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/student_loan.rb', line 15

def 
  @account_id
end

#account_numberString

The account number of the loan. For some institutions, this may be a masked version of the number (e.g., the last 4 digits instead of the entire number).

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/student_loan.rb', line 21

def 
  @account_number
end

#disbursement_datesArray[Date]

The dates on which loaned funds were disbursed or will be disbursed. These are often in the past. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Array[Date])


27
28
29
# File 'lib/the_plaid_api/models/student_loan.rb', line 27

def disbursement_dates
  @disbursement_dates
end

#expected_payoff_dateDate

The date when the student loan is expected to be paid off. Availability for this field is limited. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


33
34
35
# File 'lib/the_plaid_api/models/student_loan.rb', line 33

def expected_payoff_date
  @expected_payoff_date
end

#guarantorString

The guarantor of the student loan.

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/student_loan.rb', line 37

def guarantor
  @guarantor
end

#interest_rate_percentageFloat

The interest rate on the loan as a percentage.

Returns:

  • (Float)


41
42
43
# File 'lib/the_plaid_api/models/student_loan.rb', line 41

def interest_rate_percentage
  @interest_rate_percentage
end

#is_overdueTrueClass | FalseClass

‘true` if a payment is currently overdue. Availability for this field is limited.

Returns:

  • (TrueClass | FalseClass)


46
47
48
# File 'lib/the_plaid_api/models/student_loan.rb', line 46

def is_overdue
  @is_overdue
end

#last_payment_amountFloat

The amount of the last payment.

Returns:

  • (Float)


50
51
52
# File 'lib/the_plaid_api/models/student_loan.rb', line 50

def last_payment_amount
  @last_payment_amount
end

#last_payment_dateDate

The date of the last payment. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


55
56
57
# File 'lib/the_plaid_api/models/student_loan.rb', line 55

def last_payment_date
  @last_payment_date
end

#last_statement_balanceFloat

The total amount owed as of the last statement issued

Returns:

  • (Float)


59
60
61
# File 'lib/the_plaid_api/models/student_loan.rb', line 59

def last_statement_balance
  @last_statement_balance
end

#last_statement_issue_dateDate

The date of the last statement. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


64
65
66
# File 'lib/the_plaid_api/models/student_loan.rb', line 64

def last_statement_issue_date
  @last_statement_issue_date
end

#loan_nameString

The type of loan, e.g., “Consolidation Loans”.

Returns:

  • (String)


68
69
70
# File 'lib/the_plaid_api/models/student_loan.rb', line 68

def loan_name
  @loan_name
end

#loan_statusStudentLoanStatus

An object representing the status of the student loan

Returns:



72
73
74
# File 'lib/the_plaid_api/models/student_loan.rb', line 72

def loan_status
  @loan_status
end

#minimum_payment_amountFloat

The minimum payment due for the next billing cycle. There are some exceptions: Some institutions require a minimum payment across all loans associated with an account number. Our API presents that same minimum payment amount on each loan. The institutions that do this are: Great Lakes ( ‘ins_116861`), Firstmark (`ins_116295`), Commonbond Firstmark Services (`ins_116950`), Granite State (`ins_116308`), and Oklahoma Student Loan Authority (`ins_116945`). Firstmark (`ins_116295` ) and Navient (`ins_116248`) will display as $0 if there is an autopay program in effect.

Returns:

  • (Float)


85
86
87
# File 'lib/the_plaid_api/models/student_loan.rb', line 85

def minimum_payment_amount
  @minimum_payment_amount
end

#next_payment_due_dateDate

The due date for the next payment. The due date is ‘null` if a payment is not expected. A payment is not expected if `loan_status.type` is `deferment`, `in_school`, `consolidated`, `paid in full`, or `transferred`. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


93
94
95
# File 'lib/the_plaid_api/models/student_loan.rb', line 93

def next_payment_due_date
  @next_payment_due_date
end

#origination_dateDate

The date on which the loan was initially lent. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD).

Returns:

  • (Date)


98
99
100
# File 'lib/the_plaid_api/models/student_loan.rb', line 98

def origination_date
  @origination_date
end

#origination_principal_amountFloat

The original principal balance of the loan.

Returns:

  • (Float)


102
103
104
# File 'lib/the_plaid_api/models/student_loan.rb', line 102

def origination_principal_amount
  @origination_principal_amount
end

#outstanding_interest_amountFloat

The total dollar amount of the accrued interest balance. For Sallie Mae ( ‘ins_116944`), this amount is included in the current balance of the loan, so this field will return as `null`.

Returns:

  • (Float)


108
109
110
# File 'lib/the_plaid_api/models/student_loan.rb', line 108

def outstanding_interest_amount
  @outstanding_interest_amount
end

#payment_reference_numberString

The relevant account number that should be used to reference this loan for payments. In the majority of cases, ‘payment_reference_number` will match `account_number,` but in some institutions, such as Great Lakes (`ins_116861`), it will be different.

Returns:

  • (String)


115
116
117
# File 'lib/the_plaid_api/models/student_loan.rb', line 115

def payment_reference_number
  @payment_reference_number
end

#pslf_statusPslfStatus

Information about the student’s eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (‘ins_116527`). Since FedLoan no longer services student loans, this field is no longer returned.

Returns:



122
123
124
# File 'lib/the_plaid_api/models/student_loan.rb', line 122

def pslf_status
  @pslf_status
end

#repayment_planStudentRepaymentPlan

An object representing the repayment plan for the student loan



126
127
128
# File 'lib/the_plaid_api/models/student_loan.rb', line 126

def repayment_plan
  @repayment_plan
end

#sequence_numberString

The sequence number of the student loan. Heartland ECSI (‘ins_116948`) does not make this field available.

Returns:

  • (String)


131
132
133
# File 'lib/the_plaid_api/models/student_loan.rb', line 131

def sequence_number
  @sequence_number
end

#servicer_addressServicerAddressData

The address of the student loan servicer. This is generally the remittance address to which payments should be sent.

Returns:



136
137
138
# File 'lib/the_plaid_api/models/student_loan.rb', line 136

def servicer_address
  @servicer_address
end

#ytd_interest_paidFloat

The year to date (YTD) interest paid. Availability for this field is limited.

Returns:

  • (Float)


141
142
143
# File 'lib/the_plaid_api/models/student_loan.rb', line 141

def ytd_interest_paid
  @ytd_interest_paid
end

#ytd_principal_paidFloat

The year to date (YTD) principal paid. Availability for this field is limited.

Returns:

  • (Float)


146
147
148
# File 'lib/the_plaid_api/models/student_loan.rb', line 146

def ytd_principal_paid
  @ytd_principal_paid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
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
# File 'lib/the_plaid_api/models/student_loan.rb', line 254

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_id') ? hash['account_id'] : nil
   =
    hash.key?('account_number') ? hash['account_number'] : nil
  disbursement_dates =
    hash.key?('disbursement_dates') ? hash['disbursement_dates'] : nil
  expected_payoff_date =
    hash.key?('expected_payoff_date') ? hash['expected_payoff_date'] : nil
  guarantor = hash.key?('guarantor') ? hash['guarantor'] : nil
  interest_rate_percentage =
    hash.key?('interest_rate_percentage') ? hash['interest_rate_percentage'] : nil
  is_overdue = hash.key?('is_overdue') ? hash['is_overdue'] : nil
  last_payment_amount =
    hash.key?('last_payment_amount') ? hash['last_payment_amount'] : nil
  last_payment_date =
    hash.key?('last_payment_date') ? hash['last_payment_date'] : nil
  last_statement_issue_date =
    hash.key?('last_statement_issue_date') ? hash['last_statement_issue_date'] : nil
  loan_name = hash.key?('loan_name') ? hash['loan_name'] : nil
  loan_status = StudentLoanStatus.from_hash(hash['loan_status']) if hash['loan_status']
  minimum_payment_amount =
    hash.key?('minimum_payment_amount') ? hash['minimum_payment_amount'] : nil
  next_payment_due_date =
    hash.key?('next_payment_due_date') ? hash['next_payment_due_date'] : nil
  origination_date =
    hash.key?('origination_date') ? hash['origination_date'] : nil
  origination_principal_amount =
    hash.key?('origination_principal_amount') ? hash['origination_principal_amount'] : nil
  outstanding_interest_amount =
    hash.key?('outstanding_interest_amount') ? hash['outstanding_interest_amount'] : nil
  payment_reference_number =
    hash.key?('payment_reference_number') ? hash['payment_reference_number'] : nil
  pslf_status = PslfStatus.from_hash(hash['pslf_status']) if hash['pslf_status']
  repayment_plan = StudentRepaymentPlan.from_hash(hash['repayment_plan']) if
    hash['repayment_plan']
  sequence_number =
    hash.key?('sequence_number') ? hash['sequence_number'] : nil
  servicer_address = ServicerAddressData.from_hash(hash['servicer_address']) if
    hash['servicer_address']
  ytd_interest_paid =
    hash.key?('ytd_interest_paid') ? hash['ytd_interest_paid'] : nil
  ytd_principal_paid =
    hash.key?('ytd_principal_paid') ? hash['ytd_principal_paid'] : nil
  last_statement_balance =
    hash.key?('last_statement_balance') ? hash['last_statement_balance'] : 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.
  StudentLoan.new(account_id: ,
                  account_number: ,
                  disbursement_dates: disbursement_dates,
                  expected_payoff_date: expected_payoff_date,
                  guarantor: guarantor,
                  interest_rate_percentage: interest_rate_percentage,
                  is_overdue: is_overdue,
                  last_payment_amount: last_payment_amount,
                  last_payment_date: last_payment_date,
                  last_statement_issue_date: last_statement_issue_date,
                  loan_name: loan_name,
                  loan_status: loan_status,
                  minimum_payment_amount: minimum_payment_amount,
                  next_payment_due_date: next_payment_due_date,
                  origination_date: origination_date,
                  origination_principal_amount: origination_principal_amount,
                  outstanding_interest_amount: outstanding_interest_amount,
                  payment_reference_number: payment_reference_number,
                  pslf_status: pslf_status,
                  repayment_plan: repayment_plan,
                  sequence_number: sequence_number,
                  servicer_address: servicer_address,
                  ytd_interest_paid: ytd_interest_paid,
                  ytd_principal_paid: ytd_principal_paid,
                  last_statement_balance: last_statement_balance,
                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
177
# File 'lib/the_plaid_api/models/student_loan.rb', line 149

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'account_id'
  @_hash['account_number'] = 'account_number'
  @_hash['disbursement_dates'] = 'disbursement_dates'
  @_hash['expected_payoff_date'] = 'expected_payoff_date'
  @_hash['guarantor'] = 'guarantor'
  @_hash['interest_rate_percentage'] = 'interest_rate_percentage'
  @_hash['is_overdue'] = 'is_overdue'
  @_hash['last_payment_amount'] = 'last_payment_amount'
  @_hash['last_payment_date'] = 'last_payment_date'
  @_hash['last_statement_balance'] = 'last_statement_balance'
  @_hash['last_statement_issue_date'] = 'last_statement_issue_date'
  @_hash['loan_name'] = 'loan_name'
  @_hash['loan_status'] = 'loan_status'
  @_hash['minimum_payment_amount'] = 'minimum_payment_amount'
  @_hash['next_payment_due_date'] = 'next_payment_due_date'
  @_hash['origination_date'] = 'origination_date'
  @_hash['origination_principal_amount'] = 'origination_principal_amount'
  @_hash['outstanding_interest_amount'] = 'outstanding_interest_amount'
  @_hash['payment_reference_number'] = 'payment_reference_number'
  @_hash['pslf_status'] = 'pslf_status'
  @_hash['repayment_plan'] = 'repayment_plan'
  @_hash['sequence_number'] = 'sequence_number'
  @_hash['servicer_address'] = 'servicer_address'
  @_hash['ytd_interest_paid'] = 'ytd_interest_paid'
  @_hash['ytd_principal_paid'] = 'ytd_principal_paid'
  @_hash
end

.nullablesObject

An array for nullable fields



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/the_plaid_api/models/student_loan.rb', line 187

def self.nullables
  %w[
    account_id
    account_number
    disbursement_dates
    expected_payoff_date
    guarantor
    is_overdue
    last_payment_amount
    last_payment_date
    last_statement_balance
    last_statement_issue_date
    loan_name
    minimum_payment_amount
    next_payment_due_date
    origination_date
    origination_principal_amount
    outstanding_interest_amount
    payment_reference_number
    sequence_number
    ytd_interest_paid
    ytd_principal_paid
  ]
end

.optionalsObject

An array for optional fields



180
181
182
183
184
# File 'lib/the_plaid_api/models/student_loan.rb', line 180

def self.optionals
  %w[
    last_statement_balance
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/the_plaid_api/models/student_loan.rb', line 360

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account_number:"\
  " #{@account_number.inspect}, disbursement_dates: #{@disbursement_dates.inspect},"\
  " expected_payoff_date: #{@expected_payoff_date.inspect}, guarantor: #{@guarantor.inspect},"\
  " interest_rate_percentage: #{@interest_rate_percentage.inspect}, is_overdue:"\
  " #{@is_overdue.inspect}, last_payment_amount: #{@last_payment_amount.inspect},"\
  " last_payment_date: #{@last_payment_date.inspect}, last_statement_balance:"\
  " #{@last_statement_balance.inspect}, last_statement_issue_date:"\
  " #{@last_statement_issue_date.inspect}, loan_name: #{@loan_name.inspect}, loan_status:"\
  " #{@loan_status.inspect}, minimum_payment_amount: #{@minimum_payment_amount.inspect},"\
  " next_payment_due_date: #{@next_payment_due_date.inspect}, origination_date:"\
  " #{@origination_date.inspect}, origination_principal_amount:"\
  " #{@origination_principal_amount.inspect}, outstanding_interest_amount:"\
  " #{@outstanding_interest_amount.inspect}, payment_reference_number:"\
  " #{@payment_reference_number.inspect}, pslf_status: #{@pslf_status.inspect},"\
  " repayment_plan: #{@repayment_plan.inspect}, sequence_number: #{@sequence_number.inspect},"\
  " servicer_address: #{@servicer_address.inspect}, ytd_interest_paid:"\
  " #{@ytd_interest_paid.inspect}, ytd_principal_paid: #{@ytd_principal_paid.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/the_plaid_api/models/student_loan.rb', line 340

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account_number: #{@account_number},"\
  " disbursement_dates: #{@disbursement_dates}, expected_payoff_date:"\
  " #{@expected_payoff_date}, guarantor: #{@guarantor}, interest_rate_percentage:"\
  " #{@interest_rate_percentage}, is_overdue: #{@is_overdue}, last_payment_amount:"\
  " #{@last_payment_amount}, last_payment_date: #{@last_payment_date}, last_statement_balance:"\
  " #{@last_statement_balance}, last_statement_issue_date: #{@last_statement_issue_date},"\
  " loan_name: #{@loan_name}, loan_status: #{@loan_status}, minimum_payment_amount:"\
  " #{@minimum_payment_amount}, next_payment_due_date: #{@next_payment_due_date},"\
  " origination_date: #{@origination_date}, origination_principal_amount:"\
  " #{@origination_principal_amount}, outstanding_interest_amount:"\
  " #{@outstanding_interest_amount}, payment_reference_number: #{@payment_reference_number},"\
  " pslf_status: #{@pslf_status}, repayment_plan: #{@repayment_plan}, sequence_number:"\
  " #{@sequence_number}, servicer_address: #{@servicer_address}, ytd_interest_paid:"\
  " #{@ytd_interest_paid}, ytd_principal_paid: #{@ytd_principal_paid}, additional_properties:"\
  " #{@additional_properties}>"
end