Class: VisaAcceptanceMergedSpec::Bank2

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

Overview

Bank2 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(account: SKIP, routing_number: SKIP, iban: SKIP, swift_code: SKIP, additional_properties: nil) ⇒ Bank2

Returns a new instance of Bank2.



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 58

def initialize(account: SKIP, routing_number: SKIP, iban: SKIP,
               swift_code: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account =  unless  == SKIP
  @routing_number = routing_number unless routing_number == SKIP
  @iban = iban unless iban == SKIP
  @swift_code = swift_code unless swift_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountAccount3

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 14

def 
  @account
end

#ibanString

International Bank Account Number (IBAN) for the bank account. For some countries you can provide this number instead of the traditional bank account information. You can use this field only when scoring a direct debit transaction.

Returns:

  • (String)


25
26
27
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 25

def iban
  @iban
end

#routing_numberString

Bank routing number. This is also called the transit number.

Returns:

  • (String)


18
19
20
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 18

def routing_number
  @routing_number
end

#swift_codeString

Bank’s SWIFT code. You can use this field only when scoring a direct debit transaction. Required only for crossborder transactions.

Returns:

  • (String)


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

def swift_code
  @swift_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = Account3.from_hash(hash['account']) if hash['account']
  routing_number = hash.key?('routingNumber') ? hash['routingNumber'] : SKIP
  iban = hash.key?('iban') ? hash['iban'] : SKIP
  swift_code = hash.key?('swiftCode') ? hash['swiftCode'] : 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.
  Bank2.new(account: ,
            routing_number: routing_number,
            iban: iban,
            swift_code: swift_code,
            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account'] = 'account'
  @_hash['routing_number'] = 'routingNumber'
  @_hash['iban'] = 'iban'
  @_hash['swift_code'] = 'swiftCode'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 54

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 44

def self.optionals
  %w[
    account
    routing_number
    iban
    swift_code
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 103

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

#to_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
# File 'lib/visa_acceptance_merged_spec/models/bank2.rb', line 96

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