Class: CyberSourceMergedSpec::Bank2
- Defined in:
- lib/cyber_source_merged_spec/models/bank2.rb
Overview
Bank2 Model.
Instance Attribute Summary collapse
-
#account ⇒ Account3
TODO: Write general description for this method.
-
#iban ⇒ String
International Bank Account Number (IBAN) for the bank account.
-
#routing_number ⇒ String
Bank routing number.
-
#swift_code ⇒ String
Bank’s SWIFT code.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account: SKIP, routing_number: SKIP, iban: SKIP, swift_code: SKIP, additional_properties: nil) ⇒ Bank2
constructor
A new instance of Bank2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
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/cyber_source_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 = account unless account == 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
#account ⇒ Account3
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 14 def account @account end |
#iban ⇒ String
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.
25 26 27 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 25 def iban @iban end |
#routing_number ⇒ String
Bank routing number. This is also called the transit number.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 18 def routing_number @routing_number end |
#swift_code ⇒ String
Bank’s SWIFT code. You can use this field only when scoring a direct debit transaction. Required only for crossborder transactions.
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 31 def swift_code @swift_code end |
Class Method Details
.from_element(root) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 95 def self.from_element(root) account = XmlUtilities.from_element(root, 'Account3', Account3) routing_number = XmlUtilities.from_element(root, 'routingNumber', String) iban = XmlUtilities.from_element(root, 'iban', String) swift_code = XmlUtilities.from_element(root, 'swiftCode', String) new(account: account, routing_number: routing_number, iban: iban, swift_code: swift_code, additional_properties: additional_properties) end |
.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/cyber_source_merged_spec/models/bank2.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account = 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: account, routing_number: routing_number, iban: iban, swift_code: swift_code, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/cyber_source_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 |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 44 def self.optionals %w[ account routing_number iban swift_code ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 129 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_s ⇒ Object
Provides a human-readable string representation of the object.
122 123 124 125 126 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 122 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 |
#to_xml_element(doc, root_name) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/cyber_source_merged_spec/models/bank2.rb', line 108 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Account3', account) XmlUtilities.add_as_subelement(doc, root, 'routingNumber', routing_number) XmlUtilities.add_as_subelement(doc, root, 'iban', iban) XmlUtilities.add_as_subelement(doc, root, 'swiftCode', swift_code) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |