class PaymentsApi::Payment
Payment
Information Object
Attributes
Beneficiary
Information Object @return [Beneficiary]
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 @return [BankAccount]
Payment
Information Data @return [PaymentDetails]
Payment
ID @return [Integer]
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 @return [BankAccount]
Originator
Information Object @return [Originator]
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 @return [BankAccount]
Quote
ID @return [Integer]
Payment
Information Data @return [PaymentStatus]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/payments_api/models/payment.rb, line 93 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. quote_id = hash['quoteId'] originator = Originator.from_hash(hash['originator']) if hash['originator'] beneficiary = Beneficiary.from_hash(hash['beneficiary']) if hash['beneficiary'] if hash['beneficiaryBankAccount'] beneficiary_bank_account = BankAccount.from_hash(hash['beneficiaryBankAccount']) end details = PaymentDetails.from_hash(hash['details']) if hash['details'] id = hash['id'] if hash['originatorBankAccount'] originator_bank_account = BankAccount.from_hash(hash['originatorBankAccount']) end if hash['intermediaryBankAccount'] intermediary_bank_account = BankAccount.from_hash(hash['intermediaryBankAccount']) end status = PaymentStatus.from_hash(hash['status']) if hash['status'] # Create object from extracted values. Payment.new(quote_id, originator, beneficiary, beneficiary_bank_account, details, id, originator_bank_account, intermediary_bank_account, status) end
A mapping from model property names to API property names.
# File lib/payments_api/models/payment.rb, line 58 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['quote_id'] = 'quoteId' @_hash['originator'] = 'originator' @_hash['originator_bank_account'] = 'originatorBankAccount' @_hash['beneficiary'] = 'beneficiary' @_hash['beneficiary_bank_account'] = 'beneficiaryBankAccount' @_hash['intermediary_bank_account'] = 'intermediaryBankAccount' @_hash['details'] = 'details' @_hash['status'] = 'status' @_hash end
# File lib/payments_api/models/payment.rb, line 72 def initialize(quote_id = nil, originator = nil, beneficiary = nil, beneficiary_bank_account = nil, details = nil, id = nil, originator_bank_account = nil, intermediary_bank_account = nil, status = nil) @id = id @quote_id = quote_id @originator = originator @originator_bank_account = originator_bank_account @beneficiary = beneficiary @beneficiary_bank_account = beneficiary_bank_account @intermediary_bank_account = intermediary_bank_account @details = details @status = status end