Class: CyberSourceMergedSpec::Bank7
- Defined in:
- lib/cyber_source_merged_spec/models/bank7.rb
Overview
Bank7 Model.
Instance Attribute Summary collapse
-
#account ⇒ Account9
TODO: Write general description for this method.
-
#account_alias ⇒ AccountAlias1
The scheme that sets the rules for the direct debit process.
-
#iban ⇒ String
International Bank Account Number (IBAN).
-
#scheme ⇒ String
The scheme that sets the rules for the direct debit process.
-
#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, iban: SKIP, swift_code: SKIP, scheme: SKIP, account_alias: SKIP, additional_properties: nil) ⇒ Bank7
constructor
A new instance of Bank7.
-
#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, iban: SKIP, swift_code: SKIP, scheme: SKIP, account_alias: SKIP, additional_properties: nil) ⇒ Bank7
Returns a new instance of Bank7.
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 74 def initialize(account: SKIP, iban: SKIP, swift_code: SKIP, scheme: SKIP, account_alias: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account = account unless account == SKIP @iban = iban unless iban == SKIP @swift_code = swift_code unless swift_code == SKIP @scheme = scheme unless scheme == SKIP @account_alias = account_alias unless account_alias == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account ⇒ Account9
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 14 def account @account end |
#account_alias ⇒ AccountAlias1
The scheme that sets the rules for the direct debit process. Possible values:
- SEPA
- BACS
SEPA/BACS
Required for mandates services
45 46 47 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 45 def account_alias @account_alias end |
#iban ⇒ String
International Bank Account Number (IBAN).
SEPA
Required for mandates services
20 21 22 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 20 def iban @iban end |
#scheme ⇒ String
The scheme that sets the rules for the direct debit process. Possible values:
- SEPA
- BACS
SEPA/BACS
Required for mandates services
36 37 38 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 36 def scheme @scheme end |
#swift_code ⇒ String
Bank’s SWIFT code. You can use this field only when scoring a direct debit transaction.
BACS
Required for mandates services
27 28 29 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 27 def swift_code @swift_code end |
Class Method Details
.from_element(root) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 114 def self.from_element(root) account = XmlUtilities.from_element(root, 'Account9', Account9) iban = XmlUtilities.from_element(root, 'iban', String) swift_code = XmlUtilities.from_element(root, 'swiftCode', String) scheme = XmlUtilities.from_element(root, 'scheme', String) account_alias = XmlUtilities.from_element(root, 'AccountAlias1', AccountAlias1) new(account: account, iban: iban, swift_code: swift_code, scheme: scheme, account_alias: account_alias, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account = Account9.from_hash(hash['account']) if hash['account'] iban = hash.key?('iban') ? hash['iban'] : SKIP swift_code = hash.key?('swiftCode') ? hash['swiftCode'] : SKIP scheme = hash.key?('scheme') ? hash['scheme'] : SKIP account_alias = AccountAlias1.from_hash(hash['accountAlias']) if hash['accountAlias'] # 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. Bank7.new(account: account, iban: iban, swift_code: swift_code, scheme: scheme, account_alias: account_alias, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
48 49 50 51 52 53 54 55 56 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 48 def self.names @_hash = {} if @_hash.nil? @_hash['account'] = 'account' @_hash['iban'] = 'iban' @_hash['swift_code'] = 'swiftCode' @_hash['scheme'] = 'scheme' @_hash['account_alias'] = 'accountAlias' @_hash end |
.nullables ⇒ Object
An array for nullable fields
70 71 72 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 70 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
59 60 61 62 63 64 65 66 67 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 59 def self.optionals %w[ account iban swift_code scheme account_alias ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} account: #{@account.inspect}, iban: #{@iban.inspect}, swift_code:"\ " #{@swift_code.inspect}, scheme: #{@scheme.inspect}, account_alias:"\ " #{@account_alias.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
145 146 147 148 149 150 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 145 def to_s class_name = self.class.name.split('::').last "<#{class_name} account: #{@account}, iban: #{@iban}, swift_code: #{@swift_code}, scheme:"\ " #{@scheme}, account_alias: #{@account_alias}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/cyber_source_merged_spec/models/bank7.rb', line 130 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Account9', account) XmlUtilities.add_as_subelement(doc, root, 'iban', iban) XmlUtilities.add_as_subelement(doc, root, 'swiftCode', swift_code) XmlUtilities.add_as_subelement(doc, root, 'scheme', scheme) XmlUtilities.add_as_subelement(doc, root, 'AccountAlias1', account_alias) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |