Class: ThePlaidApi::RecurringTransferSkippedWebhook

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

Overview

Fired when Plaid is unable to originate a new ACH transaction of the recurring transfer on the planned date.

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:, recurring_transfer_id:, authorization_decision:, skipped_origination_date:, environment:, authorization_decision_rationale_code: SKIP, additional_properties: nil) ⇒ RecurringTransferSkippedWebhook

Returns a new instance of RecurringTransferSkippedWebhook.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 113

def initialize(webhook_type:, webhook_code:, recurring_transfer_id:,
               authorization_decision:, skipped_origination_date:,
               environment:, authorization_decision_rationale_code: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @webhook_type = webhook_type
  @webhook_code = webhook_code
  @recurring_transfer_id = recurring_transfer_id
  @authorization_decision = authorization_decision
  unless authorization_decision_rationale_code == SKIP
    @authorization_decision_rationale_code =
      authorization_decision_rationale_code
  end
  @skipped_origination_date = skipped_origination_date
  @environment = environment
  @additional_properties = additional_properties
end

Instance Attribute Details

#authorization_decisionTransferAuthorizationDecision

A decision regarding the proposed transfer. ‘approved` – The proposed transfer has received the end user’s consent and has been approved for processing by Plaid. The ‘decision_rationale` field is set if Plaid was unable to fetch the account information. You may proceed with the transfer, but further review is recommended. Refer to the `code` field in the `decision_rationale` object for details. `declined` – Plaid reviewed the proposed transfer and declined processing. Refer to the `code` field in the `decision_rationale` object for details. `user_action_required` – An action is required before Plaid can assess the transfer risk and make a decision. The most common scenario is to update authentication for an Item. To complete the required action, initialize Link by setting `transfer.authorization_id` in the request of `/link/token/create`. After Link flow is completed, you may re-attempt the authorization request. For `guarantee` requests, `approved` indicates the transfer is eligible for Plaid’s guarantee, and ‘declined` indicates Plaid will not provide guarantee coverage for the transfer. `user_action_required` indicates you should follow the above guidance before re-attempting.



44
45
46
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 44

def authorization_decision
  @authorization_decision
end

#authorization_decision_rationale_codeTransferAuthorizationDecisionRationaleCode

A code representing the rationale for approving or declining the proposed transfer. If the ‘rationale_code` is `null`, the transfer passed the authorization check. Any non-`null` value for an `approved` transfer indicates that the the authorization check could not be run and that you should perform your own risk assessment on the transfer. The code will indicate why the check could not be run. Possible values for an `approved` transfer are: `MANUALLY_VERIFIED_ITEM` – Item created via a manual entry flow (i.e. Same Day Micro-deposit, Instant Micro-deposit, or database-based verification), limited information available. `ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link and setting [`transfer.authorization_id`](plaid.com/docs/api/link/#link-token- create-request-transfer-authorization-id) in the request to `/link/token/create`. `MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/migrate_account` endpoint, limited information available. `ERROR` – Unable to collect the account information due to an unspecified error. The following codes indicate that the authorization decision was `declined`: `NSF` – Transaction likely to result in a return due to insufficient funds. `RISK` - Transaction is high-risk. `TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit. Check the accompanying `description` field to understand which limit has been reached.



75
76
77
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 75

def authorization_decision_rationale_code
  @authorization_decision_rationale_code
end

#environmentWebhookEnvironmentValues

The Plaid environment the webhook was sent from



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

def environment
  @environment
end

#recurring_transfer_idString

Plaid’s unique identifier for a recurring transfer.

Returns:

  • (String)


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

def recurring_transfer_id
  @recurring_transfer_id
end

#skipped_origination_dateDate

The planned date on which Plaid is unable to originate a new ACH transaction of the recurring transfer. This will be of the form YYYY-MM-DD.

Returns:

  • (Date)


81
82
83
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 81

def skipped_origination_date
  @skipped_origination_date
end

#webhook_codeString

‘RECURRING_TRANSFER_SKIPPED`

Returns:

  • (String)


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

def webhook_code
  @webhook_code
end

#webhook_typeString

‘TRANSFER`

Returns:

  • (String)


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

def webhook_type
  @webhook_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 134

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
  recurring_transfer_id =
    hash.key?('recurring_transfer_id') ? hash['recurring_transfer_id'] : nil
  authorization_decision =
    hash.key?('authorization_decision') ? hash['authorization_decision'] : nil
  skipped_origination_date =
    hash.key?('skipped_origination_date') ? hash['skipped_origination_date'] : nil
  environment = hash.key?('environment') ? hash['environment'] : nil
  authorization_decision_rationale_code =
    hash.key?('authorization_decision_rationale_code') ? hash['authorization_decision_rationale_code'] : 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.
  RecurringTransferSkippedWebhook.new(webhook_type: webhook_type,
                                      webhook_code: webhook_code,
                                      recurring_transfer_id: recurring_transfer_id,
                                      authorization_decision: authorization_decision,
                                      skipped_origination_date: skipped_origination_date,
                                      environment: environment,
                                      authorization_decision_rationale_code: authorization_decision_rationale_code,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 88

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['webhook_type'] = 'webhook_type'
  @_hash['webhook_code'] = 'webhook_code'
  @_hash['recurring_transfer_id'] = 'recurring_transfer_id'
  @_hash['authorization_decision'] = 'authorization_decision'
  @_hash['authorization_decision_rationale_code'] =
    'authorization_decision_rationale_code'
  @_hash['skipped_origination_date'] = 'skipped_origination_date'
  @_hash['environment'] = 'environment'
  @_hash
end

.nullablesObject

An array for nullable fields



109
110
111
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 109

def self.nullables
  []
end

.optionalsObject

An array for optional fields



102
103
104
105
106
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 102

def self.optionals
  %w[
    authorization_decision_rationale_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



180
181
182
183
184
185
186
187
188
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 180

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

#to_sObject

Provides a human-readable string representation of the object.



169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/recurring_transfer_skipped_webhook.rb', line 169

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