Class: VisaAcceptanceMergedSpec::Account1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/account1.rb

Overview

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

Returns a new instance of Account1.



72
73
74
75
76
77
78
79
80
81
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 72

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

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

Instance Attribute Details

#funds_sourceString

Source of funds. Possible Values:

  • 01: Credit.
  • 02: Debit.
  • 03: Prepaid.
  • 04: Deposit Account.
  • 05: Mobile Money Account.
  • 06: Cash.
  • 07: Other.
  • V5: Debits / deposit access other than those linked to the cardholders’ scheme.
  • V6: Credit accounts other than those linked to the cardholder’s scheme.

Returns:

  • (String)


47
48
49
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 47

def funds_source
  @funds_source
end

#numberString

The account number of the entity funding the transaction. The value for this field can be a payment card account number or bank account number.

Returns:

  • (String)


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 15

def number
  @number
end

#typeString

Identifies the sender’s account type. This field is applicable for AFT transactions. Valid values are:

- `00` for Other
- `01` for Routing Transit Number (RTN) + Bank Account Number (BAN)
- `02` for International Bank Account Number (IBAN)
- `03` for Card Account
- `04` for Email
- `05` for Phone Number
- `06` for Bank Account Number (BAN) + Bank Identification Code (BIC),

also known as a SWIFT code

  • 07 for Wallet ID
  • 08 for Social Network ID

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 31

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 84

def self.from_hash(hash)
  return nil unless hash

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

.namesObject

A mapping from model property names to API property names.



50
51
52
53
54
55
56
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 50

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

.nullablesObject

An array for nullable fields



68
69
70
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 68

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 59

def self.optionals
  %w[
    number
    type
    funds_source
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



114
115
116
117
118
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 114

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

#to_sObject

Provides a human-readable string representation of the object.



107
108
109
110
111
# File 'lib/visa_acceptance_merged_spec/models/account1.rb', line 107

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