Class: CyberSourceMergedSpec::Bank15

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

Overview

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

Returns a new instance of Bank15.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 88

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

  @routing_number = routing_number unless routing_number == SKIP
  @branch_code = branch_code unless branch_code == SKIP
  @swift_code = swift_code unless swift_code == SKIP
  @bank_code = bank_code unless bank_code == SKIP
  @iban = iban unless iban == SKIP
  @account =  unless  == SKIP
  @mandate = mandate unless mandate == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountAccount18

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:



48
49
50
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 48

def 
  @account
end

#bank_codeString

Country-specific code used to identify the customer’s bank. Required for some countries if you do not or are not allowed to provide the IBAN instead. You can use this field only when scoring a direct debit transaction.

Returns:

  • (String)


34
35
36
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 34

def bank_code
  @bank_code
end

#branch_codeString

Code used to identify the branch of the customer’s bank. Required for some countries if you do not or are not allowed to provide the IBAN. Use this field only when scoring a direct debit transaction.

Returns:

  • (String)


21
22
23
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 21

def branch_code
  @branch_code
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)


41
42
43
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 41

def iban
  @iban
end

#mandateMandate1

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:



55
56
57
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 55

def mandate
  @mandate
end

#routing_numberString

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

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 14

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)


27
28
29
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 27

def swift_code
  @swift_code
end

Class Method Details

.from_element(root) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 135

def self.from_element(root)
  routing_number = XmlUtilities.from_element(root, 'routingNumber', String)
  branch_code = XmlUtilities.from_element(root, 'branchCode', String)
  swift_code = XmlUtilities.from_element(root, 'swiftCode', String)
  bank_code = XmlUtilities.from_element(root, 'bankCode', String)
  iban = XmlUtilities.from_element(root, 'iban', String)
   = XmlUtilities.from_element(root, 'Account18', Account18)
  mandate = XmlUtilities.from_element(root, 'Mandate1', Mandate1)

  new(routing_number: routing_number,
      branch_code: branch_code,
      swift_code: swift_code,
      bank_code: bank_code,
      iban: iban,
      account: ,
      mandate: mandate,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 105

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  routing_number = hash.key?('routingNumber') ? hash['routingNumber'] : SKIP
  branch_code = hash.key?('branchCode') ? hash['branchCode'] : SKIP
  swift_code = hash.key?('swiftCode') ? hash['swiftCode'] : SKIP
  bank_code = hash.key?('bankCode') ? hash['bankCode'] : SKIP
  iban = hash.key?('iban') ? hash['iban'] : SKIP
   = Account18.from_hash(hash['account']) if hash['account']
  mandate = Mandate1.from_hash(hash['mandate']) if hash['mandate']

  # 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.
  Bank15.new(routing_number: routing_number,
             branch_code: branch_code,
             swift_code: swift_code,
             bank_code: bank_code,
             iban: iban,
             account: ,
             mandate: mandate,
             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



84
85
86
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 84

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



179
180
181
182
183
184
185
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 179

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

#to_sObject

Provides a human-readable string representation of the object.



171
172
173
174
175
176
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 171

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

#to_xml_element(doc, root_name) ⇒ Object



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/cyber_source_merged_spec/models/bank15.rb', line 154

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

  XmlUtilities.add_as_subelement(doc, root, 'routingNumber', routing_number)
  XmlUtilities.add_as_subelement(doc, root, 'branchCode', branch_code)
  XmlUtilities.add_as_subelement(doc, root, 'swiftCode', swift_code)
  XmlUtilities.add_as_subelement(doc, root, 'bankCode', bank_code)
  XmlUtilities.add_as_subelement(doc, root, 'iban', iban)
  XmlUtilities.add_as_subelement(doc, root, 'Account18', )
  XmlUtilities.add_as_subelement(doc, root, 'Mandate1', mandate)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end