Class: FdxV660Api::FundingSource

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

Overview

Accounts for customer's alternate funding sources from which FI can transfer funds to cover transactions if customer has overdraft protection from a consented account. In the order of which accounts will be attempted to transfer the coverage amount needed. Contains masked or truncated account number or nickname, account type and/or institution name for full clarity on an internal or external funding source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(account_id: SKIP, account_number_display: SKIP, account_type: SKIP, institution_name: SKIP, additional_properties: nil) ⇒ FundingSource

Returns a new instance of FundingSource.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/fdx_v660_api/models/funding_source.rb', line 60

def initialize(account_id: SKIP, account_number_display: SKIP,
               account_type: SKIP, institution_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id =  unless  == SKIP
  @account_number_display =  unless  == SKIP
  @account_type =  unless  == SKIP
  @institution_name = institution_name unless institution_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

Long-term persistent identity of the funding source account, not an account number. This identity must be unique to the owning institution

Returns:

  • (String)


20
21
22
# File 'lib/fdx_v660_api/models/funding_source.rb', line 20

def 
  @account_id
end

#account_number_displayString

Funding source account's masked or truncated account number or its nickname for display to the customer

Returns:

  • (String)


25
26
27
# File 'lib/fdx_v660_api/models/funding_source.rb', line 25

def 
  @account_number_display
end

#account_typeAccountType1

Type of the funding source account

Returns:



29
30
31
# File 'lib/fdx_v660_api/models/funding_source.rb', line 29

def 
  @account_type
end

#institution_nameString

The name of the institution holding the account

Returns:

  • (String)


33
34
35
# File 'lib/fdx_v660_api/models/funding_source.rb', line 33

def institution_name
  @institution_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/fdx_v660_api/models/funding_source.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountId') ? hash['accountId'] : SKIP
   =
    hash.key?('accountNumberDisplay') ? hash['accountNumberDisplay'] : SKIP
   = hash.key?('accountType') ? hash['accountType'] : SKIP
  institution_name =
    hash.key?('institutionName') ? hash['institutionName'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  FundingSource.new(account_id: ,
                    account_number_display: ,
                    account_type: ,
                    institution_name: institution_name,
                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
# File 'lib/fdx_v660_api/models/funding_source.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'accountId'
  @_hash['account_number_display'] = 'accountNumberDisplay'
  @_hash['account_type'] = 'accountType'
  @_hash['institution_name'] = 'institutionName'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/fdx_v660_api/models/funding_source.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
53
# File 'lib/fdx_v660_api/models/funding_source.rb', line 46

def self.optionals
  %w[
    account_id
    account_number_display
    account_type
    institution_name
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (FundingSource | Hash)

    value against the validation is performed.



102
103
104
105
106
107
108
# File 'lib/fdx_v660_api/models/funding_source.rb', line 102

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



119
120
121
122
123
124
125
# File 'lib/fdx_v660_api/models/funding_source.rb', line 119

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account_number_display:"\
  " #{@account_number_display.inspect}, account_type: #{@account_type.inspect},"\
  " institution_name: #{@institution_name.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



111
112
113
114
115
116
# File 'lib/fdx_v660_api/models/funding_source.rb', line 111

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account_number_display:"\
  " #{@account_number_display}, account_type: #{@account_type}, institution_name:"\
  " #{@institution_name}, additional_properties: #{@additional_properties}>"
end