class PaymentsApi::Quote

Quote Information Object

Attributes

beneficiary_amount[RW]

Amount to send in beneficiary currency. Not required if originatorAmount is provided. @return [Float]

beneficiary_currency[RW]

Beneficiary currency code in ISO 4217 format @return [String]

exchange_rate[RW]

The exchange rate for the quote @return [Float]

id[RW]

Quote ID @return [Integer]

locked[RW]

Set to true if the quote rate is locked @return [Boolean]

originator_amount[RW]

Amount to send in originator currency. Not required if beneficiaryAmount is provided @return [Float]

originator_amount_is_fixed[RW]

If true, then the originator amount is fixed to the provided value. If false, then the beneficiary amount is fixed to the provided value. This field is automatically set based on whether the originator or beneficary amount was provided. @return [Boolean]

revision[RW]

Quote revision number. This is automatically incremented each time the quote is refreshed or updated, and starts from 1 @return [Integer]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/payments_api/models/quote.rb, line 80
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  beneficiary_currency = hash['beneficiaryCurrency']
  id = hash['id']
  beneficiary_amount = hash['beneficiaryAmount']
  originator_amount = hash['originatorAmount']
  originator_amount_is_fixed = hash['originatorAmountIsFixed']
  exchange_rate = hash['exchangeRate']
  locked = hash['locked']
  revision = hash['revision']

  # Create object from extracted values.
  Quote.new(beneficiary_currency,
            id,
            beneficiary_amount,
            originator_amount,
            originator_amount_is_fixed,
            exchange_rate,
            locked,
            revision)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/payments_api/models/quote.rb, line 48
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['beneficiary_amount'] = 'beneficiaryAmount'
  @_hash['beneficiary_currency'] = 'beneficiaryCurrency'
  @_hash['originator_amount'] = 'originatorAmount'
  @_hash['originator_amount_is_fixed'] = 'originatorAmountIsFixed'
  @_hash['exchange_rate'] = 'exchangeRate'
  @_hash['locked'] = 'locked'
  @_hash['revision'] = 'revision'
  @_hash
end
new(beneficiary_currency = nil, id = nil, beneficiary_amount = nil, originator_amount = nil, originator_amount_is_fixed = nil, exchange_rate = nil, locked = nil, revision = nil) click to toggle source
# File lib/payments_api/models/quote.rb, line 61
def initialize(beneficiary_currency = nil,
               id = nil,
               beneficiary_amount = nil,
               originator_amount = nil,
               originator_amount_is_fixed = nil,
               exchange_rate = nil,
               locked = nil,
               revision = nil)
  @id = id
  @beneficiary_amount = beneficiary_amount
  @beneficiary_currency = beneficiary_currency
  @originator_amount = originator_amount
  @originator_amount_is_fixed = originator_amount_is_fixed
  @exchange_rate = exchange_rate
  @locked = locked
  @revision = revision
end