Class: ThePlaidApi::LayerAuthenticationPassedWebhook

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

Overview

Indicates that Plaid’s authentication process has completed for a user and that Plaid has verified that the user owns their phone number. If you receive this webhook, you should skip your own OTP phone number verification flow for the user, even if the user does not complete the entire Link flow. If the user doesn’t complete the full Link flow (as verified by your being able to successfully call ‘/user_account/session/get` using the `public_token` from the `onSuccess` callback) it is recommended that you implement [webhook verification](plaid.com/docs/api/webhooks/webhook-verification/) or another technique to avoid webhook spoofing attacks.

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(webhook_type:, webhook_code:, environment:, link_session_id:, link_token:, additional_properties: nil) ⇒ LayerAuthenticationPassedWebhook

Returns a new instance of LayerAuthenticationPassedWebhook.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 62

def initialize(webhook_type:, webhook_code:, environment:, link_session_id:,
               link_token:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @webhook_type = webhook_type
  @webhook_code = webhook_code
  @environment = environment
  @link_session_id = link_session_id
  @link_token = link_token
  @additional_properties = additional_properties
end

Instance Attribute Details

#environmentWebhookEnvironmentValues

The Plaid environment the webhook was sent from



31
32
33
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 31

def environment
  @environment
end

An identifier for the Link session these events occurred in

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 35

def link_session_id
  @link_session_id
end

The Link token used to create the Link session these events are from

Returns:

  • (String)


39
40
41
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 39

def link_token
  @link_token
end

#webhook_codeString

‘LAYER_AUTHENTICATION_PASSED`

Returns:

  • (String)


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

def webhook_code
  @webhook_code
end

#webhook_typeString

‘LAYER`

Returns:

  • (String)


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

def webhook_type
  @webhook_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  webhook_type = hash.key?('webhook_type') ? hash['webhook_type'] : nil
  webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil
  environment = hash.key?('environment') ? hash['environment'] : nil
  link_session_id =
    hash.key?('link_session_id') ? hash['link_session_id'] : nil
  link_token = hash.key?('link_token') ? hash['link_token'] : 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.
  LayerAuthenticationPassedWebhook.new(webhook_type: webhook_type,
                                       webhook_code: webhook_code,
                                       environment: environment,
                                       link_session_id: link_session_id,
                                       link_token: link_token,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['webhook_type'] = 'webhook_type'
  @_hash['webhook_code'] = 'webhook_code'
  @_hash['environment'] = 'environment'
  @_hash['link_session_id'] = 'link_session_id'
  @_hash['link_token'] = 'link_token'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



53
54
55
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 53

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type.inspect}, webhook_code:"\
  " #{@webhook_code.inspect}, environment: #{@environment.inspect}, link_session_id:"\
  " #{@link_session_id.inspect}, link_token: #{@link_token.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
# File 'lib/the_plaid_api/models/layer_authentication_passed_webhook.rb', line 104

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type}, webhook_code: #{@webhook_code},"\
  " environment: #{@environment}, link_session_id: #{@link_session_id}, link_token:"\
  " #{@link_token}, additional_properties: #{@additional_properties}>"
end