Class: ThePlaidApi::TransactionPaymentChannel

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

Overview

The channel used to make a payment. ‘online:` transactions that took place online. `in store:` transactions that were made at a physical location. `other:` transactions that relate to banks, e.g. fees or deposits.

Constant Summary collapse

TRANSACTION_PAYMENT_CHANNEL =
[
  # TODO: Write general description for ONLINE
  ONLINE = 'online'.freeze,

  # TODO: Write general description for ENUM_IN_STORE
  ENUM_IN_STORE = 'in store'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ONLINE) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/the_plaid_api/models/transaction_payment_channel.rb', line 28

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

  str = value.to_s.strip

  case str.downcase
  when 'online' then ONLINE
  when 'enum_in_store' then ENUM_IN_STORE
  when 'other' then OTHER
  else
    default_value
  end
end

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/the_plaid_api/models/transaction_payment_channel.rb', line 22

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

  TRANSACTION_PAYMENT_CHANNEL.include?(value)
end