class PaymentsApi::Payment

Payment Information Object

Attributes

beneficiary[RW]

Beneficiary Information Object @return [Beneficiary]

beneficiary_bank_account[RW]

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]

details[RW]

Payment Information Data @return [PaymentDetails]

id[RW]

Payment ID @return [Integer]

intermediary_bank_account[RW]

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[RW]

Originator Information Object @return [Originator]

originator_bank_account[RW]

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[RW]

Quote ID @return [Integer]

status[RW]

Payment Information Data @return [PaymentStatus]

Public Class Methods

from_hash(hash) click to toggle source

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
names() click to toggle source

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
new(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) click to toggle source
# 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