Class: ThePlaidApi::VerificationInsights

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

Overview

Insights from performing database verification for the account. Only returned for Auth Items using Database Auth.

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(network_status:, account_number_format:, name_match_score: SKIP, previous_returns: SKIP, additional_properties: nil) ⇒ VerificationInsights

Returns a new instance of VerificationInsights.



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/the_plaid_api/models/verification_insights.rb', line 69

def initialize(network_status:, account_number_format:,
               name_match_score: SKIP, previous_returns: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name_match_score = name_match_score unless name_match_score == SKIP
  @network_status = network_status
  @previous_returns = previous_returns unless previous_returns == SKIP
  @account_number_format = 
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_number_formatVerificationInsightsAccountNumberFormat

Indicator of account number format validity for institution. ‘valid`: indicates that the account number has a correct format for the institution. `invalid`: indicates that the account number has an incorrect format for the institution. `unknown`: indicates that there was not enough information to determine whether the format is correct for the institution.



42
43
44
# File 'lib/the_plaid_api/models/verification_insights.rb', line 42

def 
  @account_number_format
end

#name_match_scoreInteger

Indicates the score of the name match between the given name provided during database verification (available in the [‘verification_name`](plaid.com/docs/api/products/auth/#auth-get-r esponse-accounts-verification-name) field if using standard Database Auth, or provided in the request if using `/auth/verify`) and matched Plaid network accounts. If defined, will be a value between 0 and 100. Will be undefined if name matching was not enabled for the database verification session or if there were no eligible Plaid network matches to compare the given name with.

Returns:

  • (Integer)


23
24
25
# File 'lib/the_plaid_api/models/verification_insights.rb', line 23

def name_match_score
  @name_match_score
end

#network_statusVerificationInsightsNetworkStatus

Status information about the account and routing number in the Plaid network.



28
29
30
# File 'lib/the_plaid_api/models/verification_insights.rb', line 28

def network_status
  @network_status
end

#previous_returnsVerificationInsightsNetworkStatus1

Information about known ACH returns for the account and routing number.



32
33
34
# File 'lib/the_plaid_api/models/verification_insights.rb', line 32

def previous_returns
  @previous_returns
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/the_plaid_api/models/verification_insights.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  network_status = VerificationInsightsNetworkStatus.from_hash(hash['network_status']) if
    hash['network_status']
   =
    hash.key?('account_number_format') ? hash['account_number_format'] : nil
  name_match_score =
    hash.key?('name_match_score') ? hash['name_match_score'] : SKIP
  previous_returns = VerificationInsightsNetworkStatus1.from_hash(hash['previous_returns']) if
    hash['previous_returns']

  # 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.
  VerificationInsights.new(network_status: network_status,
                           account_number_format: ,
                           name_match_score: name_match_score,
                           previous_returns: previous_returns,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/verification_insights.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name_match_score'] = 'name_match_score'
  @_hash['network_status'] = 'network_status'
  @_hash['previous_returns'] = 'previous_returns'
  @_hash['account_number_format'] = 'account_number_format'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
66
67
# File 'lib/the_plaid_api/models/verification_insights.rb', line 63

def self.nullables
  %w[
    name_match_score
  ]
end

.optionalsObject

An array for optional fields



55
56
57
58
59
60
# File 'lib/the_plaid_api/models/verification_insights.rb', line 55

def self.optionals
  %w[
    name_match_score
    previous_returns
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
125
126
# File 'lib/the_plaid_api/models/verification_insights.rb', line 120

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name_match_score: #{@name_match_score.inspect}, network_status:"\
  " #{@network_status.inspect}, previous_returns: #{@previous_returns.inspect},"\
  " account_number_format: #{@account_number_format.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



112
113
114
115
116
117
# File 'lib/the_plaid_api/models/verification_insights.rb', line 112

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name_match_score: #{@name_match_score}, network_status: #{@network_status},"\
  " previous_returns: #{@previous_returns}, account_number_format: #{@account_number_format},"\
  " additional_properties: #{@additional_properties}>"
end