class Cryptopay::InvoiceRecalculation
Constants
- ENCODER
Public Class Methods
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
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
Recalculation creation date and time
# File lib/cryptopay/models/invoice_recalculation.rb, line 112 def created_at @attributes[:created_at] end
# File lib/cryptopay/models/invoice_recalculation.rb, line 107 def exchange @attributes[:exchange] end
Processing fee
# File lib/cryptopay/models/invoice_recalculation.rb, line 83 def fee @attributes[:fee] end
Processing fee currency
# File lib/cryptopay/models/invoice_recalculation.rb, line 88 def fee_currency @attributes[:fee_currency] end
Recalculation ID
# File lib/cryptopay/models/invoice_recalculation.rb, line 53 def id @attributes[:id] end
# 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
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
# File lib/cryptopay/models/invoice_recalculation.rb, line 58 def invoice_id @attributes[:invoice_id] end
Cryptocurrency amount received
# File lib/cryptopay/models/invoice_recalculation.rb, line 63 def pay_amount @attributes[:pay_amount] end
Cryptocurrency type
# File lib/cryptopay/models/invoice_recalculation.rb, line 68 def pay_currency @attributes[:pay_currency] end
Previous exchange rate
# File lib/cryptopay/models/invoice_recalculation.rb, line 103 def previous_exchange_rate @attributes[:previous_exchange_rate] end
Previous amount to pay
# File lib/cryptopay/models/invoice_recalculation.rb, line 93 def previous_pay_amount @attributes[:previous_pay_amount] end
Previous invoice amount
# File lib/cryptopay/models/invoice_recalculation.rb, line 98 def previous_price_amount @attributes[:previous_price_amount] end
New invoice amount
# File lib/cryptopay/models/invoice_recalculation.rb, line 73 def price_amount @attributes[:price_amount] end
Invoice
amount currency
# File lib/cryptopay/models/invoice_recalculation.rb, line 78 def price_currency @attributes[:price_currency] end
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
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