Class: ThePlaidApi::TransferIntentAuthorizationDecision

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

Overview

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 (i.e., use Link in update mode to re-authenticate your user when `decision_rationale.code` is `ITEM_LOGIN_REQUIRED`). 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.

Constant Summary collapse

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = APPROVED) ⇒ Object



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

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 'declined' then DECLINED
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/the_plaid_api/models/transfer_intent_authorization_decision.rb', line 26

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

  TRANSFER_INTENT_AUTHORIZATION_DECISION.include?(value)
end