Class: ThePlaidApi::CreditSessionBankIncomeStatus

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

Overview

Status of the Bank Income Link session. ‘APPROVED`: User has approved and verified their income `NO_DEPOSITS_FOUND`: We attempted, but were unable to find any income in the connected account. `USER_REPORTED_NO_INCOME`: The user explicitly indicated that they don’t receive income in the connected account. ‘STARTED`: The user began the bank income portion of the link flow. `INTERNAL_ERROR`: The user encountered an internal error.

Constant Summary collapse

CREDIT_SESSION_BANK_INCOME_STATUS =
[
  # TODO: Write general description for APPROVED
  APPROVED = 'APPROVED'.freeze,

  # TODO: Write general description for NO_DEPOSITS_FOUND
  NO_DEPOSITS_FOUND = 'NO_DEPOSITS_FOUND'.freeze,

  # TODO: Write general description for USER_REPORTED_NO_INCOME
  USER_REPORTED_NO_INCOME = 'USER_REPORTED_NO_INCOME'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = APPROVED) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/the_plaid_api/models/credit_session_bank_income_status.rb', line 31

def self.from_value(value, default_value = APPROVED)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'approved' then APPROVED
  when 'no_deposits_found' then NO_DEPOSITS_FOUND
  when 'user_reported_no_income' then USER_REPORTED_NO_INCOME
  else
    default_value
  end
end

.validate(value) ⇒ Object



25
26
27
28
29
# File 'lib/the_plaid_api/models/credit_session_bank_income_status.rb', line 25

def self.validate(value)
  return false if value.nil?

  CREDIT_SESSION_BANK_INCOME_STATUS.include?(value)
end