Class: ThePlaidApi::AchClass

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

Overview

Specifies the use case of the transfer. Required for transfers on an ACH network. For more details, see [ACH SEC codes](plaid.com/docs/transfer/creating-transfers/#ach-sec-codes). Codes supported for credits: ‘ccd`, `ppd` Codes supported for debits: `ccd`, `tel`, `web` `“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. `“tel”` - Telephone-Initiated Entry. The transfer debits a consumer. Debit authorization has been received orally over the telephone via a recorded call.

Constant Summary collapse

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 TEL
  TEL = 'tel'.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



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

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 'tel' then TEL
  when 'web' then WEB
  else
    default_value
  end
end

.validate(value) ⇒ Object



37
38
39
40
41
# File 'lib/the_plaid_api/models/ach_class.rb', line 37

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

  ACH_CLASS.include?(value)
end