Class: ThePlaidApi::RecaptchaRequiredError

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

Overview

The request was flagged by Plaid’s fraud system, and requires additional verification to ensure they are not a bot.

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(error_type:, error_code:, display_message:, http_code:, link_user_experience:, common_causes:, troubleshooting_steps:, additional_properties: nil) ⇒ RecaptchaRequiredError

Returns a new instance of RecaptchaRequiredError.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 74

def initialize(error_type:, error_code:, display_message:, http_code:,
               link_user_experience:, common_causes:,
               troubleshooting_steps:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @error_type = error_type
  @error_code = error_code
  @display_message = display_message
  @http_code = http_code
  @link_user_experience = link_user_experience
  @common_causes = common_causes
  @troubleshooting_steps = troubleshooting_steps
  @additional_properties = additional_properties
end

Instance Attribute Details

#common_causesString

Plaid’s fraud system detects abusive traffic and considers a variety of parameters throughout Item creation requests. When a request is considered risky or possibly fraudulent, Link presents a reCAPTCHA for the user to solve.

Returns:

  • (String)


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

def common_causes
  @common_causes
end

#display_messageString

‘RECAPTCHA_REQUIRED`

Returns:

  • (String)


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

def display_message
  @display_message
end

#error_codeString

‘RECAPTCHA_REQUIRED`

Returns:

  • (String)


19
20
21
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 19

def error_code
  @error_code
end

#error_typeString

‘RECAPTCHA_ERROR`

Returns:

  • (String)


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

def error_type
  @error_type
end

#http_codeString

400

Returns:

  • (String)


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

def http_code
  @http_code
end

Your user will be prompted to solve a Google reCAPTCHA challenge in the Link Recaptcha pane. If they solve the challenge successfully, the user’s request is resubmitted and they are directed to the next Item creation step.

Returns:

  • (String)


34
35
36
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 34

def link_user_experience
  @link_user_experience
end

#troubleshooting_stepsString

Link will automatically guide your user through reCAPTCHA verification. As a general rule, we recommend instrumenting basic fraud monitoring to detect and protect your website from spam and abuse. If your user cannot verify their session, please submit a Support ticket with the following identifiers: ‘link_session_id` or `request_id`

Returns:

  • (String)


49
50
51
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 49

def troubleshooting_steps
  @troubleshooting_steps
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 91

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  error_type = hash.key?('error_type') ? hash['error_type'] : nil
  error_code = hash.key?('error_code') ? hash['error_code'] : nil
  display_message =
    hash.key?('display_message') ? hash['display_message'] : nil
  http_code = hash.key?('http_code') ? hash['http_code'] : nil
  link_user_experience =
    hash.key?('link_user_experience') ? hash['link_user_experience'] : nil
  common_causes = hash.key?('common_causes') ? hash['common_causes'] : nil
  troubleshooting_steps =
    hash.key?('troubleshooting_steps') ? hash['troubleshooting_steps'] : nil

  # 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.
  RecaptchaRequiredError.new(error_type: error_type,
                             error_code: error_code,
                             display_message: display_message,
                             http_code: http_code,
                             link_user_experience: link_user_experience,
                             common_causes: common_causes,
                             troubleshooting_steps: troubleshooting_steps,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 52

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['error_type'] = 'error_type'
  @_hash['error_code'] = 'error_code'
  @_hash['display_message'] = 'display_message'
  @_hash['http_code'] = 'http_code'
  @_hash['link_user_experience'] = 'link_user_experience'
  @_hash['common_causes'] = 'common_causes'
  @_hash['troubleshooting_steps'] = 'troubleshooting_steps'
  @_hash
end

.nullablesObject

An array for nullable fields



70
71
72
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 70

def self.nullables
  []
end

.optionalsObject

An array for optional fields



65
66
67
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 65

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
140
141
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 134

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} error_type: #{@error_type.inspect}, error_code: #{@error_code.inspect},"\
  " display_message: #{@display_message.inspect}, http_code: #{@http_code.inspect},"\
  " link_user_experience: #{@link_user_experience.inspect}, common_causes:"\
  " #{@common_causes.inspect}, troubleshooting_steps: #{@troubleshooting_steps.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



125
126
127
128
129
130
131
# File 'lib/the_plaid_api/models/recaptcha_required_error.rb', line 125

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} error_type: #{@error_type}, error_code: #{@error_code}, display_message:"\
  " #{@display_message}, http_code: #{@http_code}, link_user_experience:"\
  " #{@link_user_experience}, common_causes: #{@common_causes}, troubleshooting_steps:"\
  " #{@troubleshooting_steps}, additional_properties: #{@additional_properties}>"
end