class Cryptopay::InvoiceRecalculation

Constants

ENCODER

Public Class Methods

build_from_hash(data) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Cryptopay::InvoiceRecalculation] Returns the model itself

# File lib/cryptopay/models/invoice_recalculation.rb, line 163
def self.build_from_hash(data)
  attributes = ENCODER.build_from_hash(data)
  new(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/cryptopay/models/invoice_recalculation.rb, line 48
def initialize(attributes = {})
  @attributes = ENCODER.sanitize(attributes)
end

Public Instance Methods

created_at() click to toggle source

Recalculation creation date and time

# File lib/cryptopay/models/invoice_recalculation.rb, line 112
def created_at
  @attributes[:created_at]
end
exchange() click to toggle source
# File lib/cryptopay/models/invoice_recalculation.rb, line 107
def exchange
  @attributes[:exchange]
end
fee() click to toggle source

Processing fee

# File lib/cryptopay/models/invoice_recalculation.rb, line 83
def fee
  @attributes[:fee]
end
fee_currency() click to toggle source

Processing fee currency

# File lib/cryptopay/models/invoice_recalculation.rb, line 88
def fee_currency
  @attributes[:fee_currency]
end
id() click to toggle source

Recalculation ID

# File lib/cryptopay/models/invoice_recalculation.rb, line 53
def id
  @attributes[:id]
end
inspect() click to toggle source
# File lib/cryptopay/models/invoice_recalculation.rb, line 174
def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash)
end
invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/cryptopay/models/invoice_recalculation.rb, line 118
def invalid_properties
  properties = []

  properties.push('invalid value for "id", id cannot be nil.') if id.nil?

  properties.push('invalid value for "invoice_id", invoice_id cannot be nil.') if invoice_id.nil?

  properties.push('invalid value for "pay_amount", pay_amount cannot be nil.') if pay_amount.nil?

  properties.push('invalid value for "pay_currency", pay_currency cannot be nil.') if pay_currency.nil?

  properties.push('invalid value for "price_amount", price_amount cannot be nil.') if price_amount.nil?

  properties.push('invalid value for "price_currency", price_currency cannot be nil.') if price_currency.nil?

  properties.push('invalid value for "fee", fee cannot be nil.') if fee.nil?

  properties.push('invalid value for "fee_currency", fee_currency cannot be nil.') if fee_currency.nil?

  if previous_pay_amount.nil?
    properties.push('invalid value for "previous_pay_amount", previous_pay_amount cannot be nil.')
  end

  if previous_price_amount.nil?
    properties.push('invalid value for "previous_price_amount", previous_price_amount cannot be nil.')
  end

  exchange&.invalid_properties&.each do |prop|
    properties.push("invalid value for \"exchange\": #{prop}")
  end

  properties.push('invalid value for "created_at", created_at cannot be nil.') if created_at.nil?

  properties
end
invoice_id() click to toggle source

Invoice ID

# File lib/cryptopay/models/invoice_recalculation.rb, line 58
def invoice_id
  @attributes[:invoice_id]
end
pay_amount() click to toggle source

Cryptocurrency amount received

# File lib/cryptopay/models/invoice_recalculation.rb, line 63
def pay_amount
  @attributes[:pay_amount]
end
pay_currency() click to toggle source

Cryptocurrency type

# File lib/cryptopay/models/invoice_recalculation.rb, line 68
def pay_currency
  @attributes[:pay_currency]
end
previous_exchange_rate() click to toggle source

Previous exchange rate

# File lib/cryptopay/models/invoice_recalculation.rb, line 103
def previous_exchange_rate
  @attributes[:previous_exchange_rate]
end
previous_pay_amount() click to toggle source

Previous amount to pay

# File lib/cryptopay/models/invoice_recalculation.rb, line 93
def previous_pay_amount
  @attributes[:previous_pay_amount]
end
previous_price_amount() click to toggle source

Previous invoice amount

# File lib/cryptopay/models/invoice_recalculation.rb, line 98
def previous_price_amount
  @attributes[:previous_price_amount]
end
price_amount() click to toggle source

New invoice amount

# File lib/cryptopay/models/invoice_recalculation.rb, line 73
def price_amount
  @attributes[:price_amount]
end
price_currency() click to toggle source

Invoice amount currency

# File lib/cryptopay/models/invoice_recalculation.rb, line 78
def price_currency
  @attributes[:price_currency]
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/cryptopay/models/invoice_recalculation.rb, line 170
def to_hash
  ENCODER.to_hash(@attributes)
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/cryptopay/models/invoice_recalculation.rb, line 156
def valid?
  invalid_properties.empty?
end