Class: FdxV660Api::NotificationPayloadIdType2

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

Overview

Type of entity causing origination of the notification with the given ID

Constant Summary collapse

NOTIFICATION_PAYLOAD_ID_TYPE2 =
[
  # TODO: Write general description for ACCOUNT
  ACCOUNT = 'ACCOUNT'.freeze,

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

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

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

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

  # TODO: Write general description for PAYMENT_NETWORK
  PAYMENT_NETWORK = 'PAYMENT_NETWORK'.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) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fdx_v660_api/models/notification_payload_id_type2.rb', line 38

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

  str = value.to_s.strip

  case str.downcase
  when 'account' then ACCOUNT
  when 'consent' then CONSENT
  when 'customer' then CUSTOMER
  when 'maintenance' then MAINTENANCE
  when 'party' then PARTY
  when 'payment_network' then PAYMENT_NETWORK
  when 'tokenized_account_number' then TOKENIZED_ACCOUNT_NUMBER
  else
    default_value
  end
end

.validate(value) ⇒ Object



32
33
34
35
36
# File 'lib/fdx_v660_api/models/notification_payload_id_type2.rb', line 32

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

  true
end