Class: ThePlaidApi::CreditAchClass

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

Overview

Specifies the use case of the transfer. Required for transfers on an ACH network. ‘“ccd”` - Corporate Credit or Debit - fund transfer between two corporate bank accounts `“ppd”` - Prearranged Payment or Deposit - The transfer is part of a pre-existing relationship with a consumer. Authorization was obtained in writing either in person or via an electronic document signing, e.g. Docusign, by the consumer. Can be used for credits or debits. `“web”` - Internet-Initiated Entry. The transfer debits a consumer’s bank account. Authorization from the consumer is obtained over the Internet (e.g. a web or mobile application). Can be used for single debits or recurring debits.

Constant Summary collapse

CREDIT_ACH_CLASS =
[
  # TODO: Write general description for CCD
  CCD = 'ccd'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CCD) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/the_plaid_api/models/credit_ach_class.rb', line 35

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

  str = value.to_s.strip

  case str.downcase
  when 'ccd' then CCD
  when 'ppd' then PPD
  when 'web' then WEB
  else
    default_value
  end
end

.validate(value) ⇒ Object



29
30
31
32
33
# File 'lib/the_plaid_api/models/credit_ach_class.rb', line 29

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

  CREDIT_ACH_CLASS.include?(value)
end