Class: CyberSourceMergedSpec::Account17

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/account17.rb

Overview

Account17 Model.

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(funds_source: SKIP, number: SKIP, additional_properties: nil) ⇒ Account17

Returns a new instance of Account17.



62
63
64
65
66
67
68
69
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 62

def initialize(funds_source: SKIP, number: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @funds_source = funds_source unless funds_source == SKIP
  @number = number unless number == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#funds_sourceString

Source of funds. Possible values:

  • 01: Credit card,
  • 02: Debit card,
  • 03: Prepaid card,
  • 04: Cash,
  • 05: Debit or deposit account that is not linked to a Visa card. Includes checking accounts, savings,
  • 06: Credit account that is not linked to a Visa card. Includes credit cards and proprietary lines,
  • 07: Mobile wallet account,
  • 08: Other source of funds.

Returns:

  • (String)


24
25
26
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 24

def funds_source
  @funds_source
end

#numberString

  • Cross-border: Account number of the recipient account being funded by the AFT, is mandatory in cross-border Money Transfer AFTs.
  • Domestic: Optional in domestic AFTs.
  • Europe Domestic and intra-EEA cross-border: Account number of the recipient account being funded is mandatory in domestic and intra-EEA Money Transfer AFTs. In an AFT, this field contains the account number of the Recipient Account being funded by the AFT. Note: Inclusion of this tag is conditional; Sender Information reference number or Sender account number are required. If this tag is not included, Sender Reference number must be present and contain a reference number for the recipient account.

Returns:

  • (String)


39
40
41
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 39

def number
  @number
end

Class Method Details

.from_element(root) ⇒ Object



92
93
94
95
96
97
98
99
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 92

def self.from_element(root)
  funds_source = XmlUtilities.from_element(root, 'fundsSource', String)
  number = XmlUtilities.from_element(root, 'number', String)

  new(funds_source: funds_source,
      number: number,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  funds_source = hash.key?('fundsSource') ? hash['fundsSource'] : SKIP
  number = hash.key?('number') ? hash['number'] : 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.
  Account17.new(funds_source: funds_source,
                number: number,
                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['funds_source'] = 'fundsSource'
  @_hash['number'] = 'number'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 50

def self.optionals
  %w[
    funds_source
    number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



120
121
122
123
124
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 120

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

#to_sObject

Provides a human-readable string representation of the object.



113
114
115
116
117
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 113

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

#to_xml_element(doc, root_name) ⇒ Object



101
102
103
104
105
106
107
108
109
110
# File 'lib/cyber_source_merged_spec/models/account17.rb', line 101

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'fundsSource', funds_source)
  XmlUtilities.add_as_subelement(doc, root, 'number', number)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end