Class: FdxV660Api::BankIdType

Inherits:
Object
  • Object
show all
Defined in:
lib/fdx_v660_api/models/bank_id_type.rb

Overview

Enumerated values for type of bankId, or routing number. bankId and bankIdType can both be omitted if not needed, such as for IBAN transfers or Canadian institutions | Value | Description | |-------|-------------| | BIC | Bank Identifier Code, also known as SWIFT code. Typically 8 or 11 characters long and includes information like the bank, country, and location | | CA_ROUTING_NUMBER | The Canadian 3-digit Institution ID (FID) and 5-digit Transit numbers in bankInstitutionId and bankTransitId, including leading zeroes | | US_ABA_NUMBER | The typically 9-digit routing transit number (RTN) associated with the account number at a US institution |

Constant Summary collapse

BANK_ID_TYPE =
[
  # TODO: Write general description for BIC
  BIC = 'BIC'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BIC) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'bic' then BIC
  when 'ca_routing_number' then CA_ROUTING_NUMBER
  when 'us_aba_number' then US_ABA_NUMBER
  else
    default_value
  end
end

.validate(value) ⇒ Object



29
30
31
32
33
# File 'lib/fdx_v660_api/models/bank_id_type.rb', line 29

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

  true
end