Class: FdxV660Api::PaymentNetworkIdentifierType

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

Overview

Enumerated values for type of account identifier used on a payment network. | Value | Description | |-------|-------------| | ACCOUNT_NUMBER | The 'real' account number, which is sensitive data and should only be exchanged if encrypted | | IBAN | International Bank Account Number used with BIC (aka SWIFT code), also sensitive data and should only be exchanged if encrypted | | TOKENIZED_ACCOUNT_NUMBER | A token representation of an account number which Provider or Token Issuer can use to identify the real account |

Constant Summary collapse

PAYMENT_NETWORK_IDENTIFIER_TYPE =
[
  # TODO: Write general description for ACCOUNT_NUMBER
  ACCOUNT_NUMBER = 'ACCOUNT_NUMBER'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACCOUNT_NUMBER) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fdx_v660_api/models/payment_network_identifier_type.rb', line 33

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

  str = value.to_s.strip

  case str.downcase
  when 'account_number' then ACCOUNT_NUMBER
  when 'iban' then IBAN
  when 'tokenized_account_number' then TOKENIZED_ACCOUNT_NUMBER
  else
    default_value
  end
end

.validate(value) ⇒ Object



27
28
29
30
31
# File 'lib/fdx_v660_api/models/payment_network_identifier_type.rb', line 27

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

  true
end