Class: CyberSourceMergedSpec::Bank14
- Defined in:
- lib/cyber_source_merged_spec/models/bank14.rb
Overview
Customer's bank account details
Instance Attribute Summary collapse
-
#account_number ⇒ String
Customer's bank account number.
-
#code ⇒ String
Country-specific code used to identify the customer’s bank.
-
#country ⇒ String
Country where the bank is located.
-
#iban ⇒ String
International Bank Account Number (IBAN) for the bank account.
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_number: SKIP, code: SKIP, country: SKIP, iban: SKIP, additional_properties: nil) ⇒ Bank14
constructor
A new instance of Bank14.
-
#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_number: SKIP, code: SKIP, country: SKIP, iban: SKIP, additional_properties: nil) ⇒ Bank14
Returns a new instance of Bank14.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 66 def initialize(account_number: SKIP, code: SKIP, country: SKIP, iban: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_number = account_number unless account_number == SKIP @code = code unless code == SKIP @country = country unless country == SKIP @iban = iban unless iban == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ String
Customer's bank account number. You can use this field only when scoring a direct debit transaction. Use this field if you do not or are not allowed to provide the IBAN. Note Do not use the IBAN in this field. Use nly the traditional account number information. For the IBAN, use bank_iban.
17 18 19 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 17 def account_number @account_number end |
#code ⇒ String
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. For specific requirements, see "Required Bank Account Information by Country,"
25 26 27 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 25 def code @code end |
#country ⇒ String
Country where the bank is located. Use the two-character ISO codes. You can use this field only when scoring a direct debit transaction.
30 31 32 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 30 def country @country 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. For specific requirements, see "Required Bank Account Information by Country,"
39 40 41 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 39 def iban @iban end |
Class Method Details
.from_element(root) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 103 def self.from_element(root) account_number = XmlUtilities.from_element(root, 'accountNumber', String) code = XmlUtilities.from_element(root, 'code', String) country = XmlUtilities.from_element(root, 'country', String) iban = XmlUtilities.from_element(root, 'iban', String) new(account_number: account_number, code: code, country: country, iban: iban, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP code = hash.key?('code') ? hash['code'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP iban = hash.key?('iban') ? hash['iban'] : 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. Bank14.new(account_number: account_number, code: code, country: country, iban: iban, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'accountNumber' @_hash['code'] = 'code' @_hash['country'] = 'country' @_hash['iban'] = 'iban' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 62 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 52 def self.optionals %w[ account_number code country iban ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, code: #{@code.inspect},"\ " country: #{@country.inspect}, iban: #{@iban.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, code: #{@code}, country: #{@country},"\ " iban: #{@iban}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/cyber_source_merged_spec/models/bank14.rb', line 116 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'accountNumber', account_number) XmlUtilities.add_as_subelement(doc, root, 'code', code) XmlUtilities.add_as_subelement(doc, root, 'country', country) XmlUtilities.add_as_subelement(doc, root, 'iban', iban) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |