Class: PaymentsApi::BankAccount
- Defined in:
- lib/payments_api/models/bank_account.rb
Overview
Bank Account Information Object.NOTE - originatorBankAccount bank data should not be provided when creating a new Payment. This information is retrieved from the database based on the provided bank ID.NOTE - bank object is required for all BankAccount objects except originatorBankAccount
Instance Attribute Summary collapse
-
#account_number ⇒ String
Bank Account Number / IBAN.
-
#bank ⇒ Bank
Bank Information Object.
Class Method Summary collapse
-
.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.
Instance Method Summary collapse
-
#initialize(account_number = nil, bank = nil) ⇒ BankAccount
constructor
A new instance of BankAccount.
Methods inherited from BaseModel
Constructor Details
#initialize(account_number = nil, bank = nil) ⇒ BankAccount
Returns a new instance of BankAccount.
29 30 31 32 33 |
# File 'lib/payments_api/models/bank_account.rb', line 29 def initialize(account_number = nil, bank = nil) @account_number = account_number @bank = bank end |
Instance Attribute Details
#account_number ⇒ String
Bank Account Number / IBAN. Required for Beneficiary Bank. Optional for Intermediary Bank.
15 16 17 |
# File 'lib/payments_api/models/bank_account.rb', line 15 def account_number @account_number end |
#bank ⇒ Bank
Bank Information Object
19 20 21 |
# File 'lib/payments_api/models/bank_account.rb', line 19 def bank @bank end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/payments_api/models/bank_account.rb', line 36 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash['accountNumber'] bank = Bank.from_hash(hash['bank']) if hash['bank'] # Create object from extracted values. BankAccount.new(account_number, bank) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/payments_api/models/bank_account.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'accountNumber' @_hash['bank'] = 'bank' @_hash end |