Class: ThePlaidApi::SignalDecisionOutcome

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

Overview

The payment decision from the risk assessment. ‘APPROVE`: approve the transaction without requiring further actions from your customers. For example, use this field if you are placing a standard hold for all the approved transactions before making funds available to your customers. You should also use this field if you decide to accelerate the fund availability for your customers. `REVIEW`: the transaction requires manual review `REJECT`: reject the transaction `TAKE_OTHER_RISK_MEASURES`: for example, placing a longer hold on funds than those approved transactions or introducing customer frictions such as step-up verification/authentication `NOT_EVALUATED`: if only logging the results without using them

Constant Summary collapse

SIGNAL_DECISION_OUTCOME =
[
  # TODO: Write general description for APPROVE
  APPROVE = 'APPROVE'.freeze,

  # TODO: Write general description for REVIEW
  REVIEW = 'REVIEW'.freeze,

  # TODO: Write general description for REJECT
  REJECT = 'REJECT'.freeze,

  # TODO: Write general description for TAKE_OTHER_RISK_MEASURES
  TAKE_OTHER_RISK_MEASURES = 'TAKE_OTHER_RISK_MEASURES'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = APPROVE) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/signal_decision_outcome.rb', line 41

def self.from_value(value, default_value = APPROVE)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'approve' then APPROVE
  when 'review' then REVIEW
  when 'reject' then REJECT
  when 'take_other_risk_measures' then TAKE_OTHER_RISK_MEASURES
  when 'not_evaluated' then NOT_EVALUATED
  else
    default_value
  end
end

.validate(value) ⇒ Object



35
36
37
38
39
# File 'lib/the_plaid_api/models/signal_decision_outcome.rb', line 35

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

  SIGNAL_DECISION_OUTCOME.include?(value)
end