class Cryptopay::InvoiceRefund

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::InvoiceRefund] Returns the model itself

# File lib/cryptopay/models/invoice_refund.rb, line 139
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_refund.rb, line 46
def initialize(attributes = {})
  @attributes = ENCODER.sanitize(attributes)
end

Public Instance Methods

address() click to toggle source

Cryptocurrency address the refund transaction sent to

# File lib/cryptopay/models/invoice_refund.rb, line 86
def address
  @attributes[:address]
end
amount() click to toggle source

Refund amount

# File lib/cryptopay/models/invoice_refund.rb, line 66
def amount
  @attributes[:amount]
end
amount_currency() click to toggle source

Refund currency

# File lib/cryptopay/models/invoice_refund.rb, line 71
def amount_currency
  @attributes[:amount_currency]
end
created_at() click to toggle source

Refund transaction creation date and time

# File lib/cryptopay/models/invoice_refund.rb, line 100
def created_at
  @attributes[:created_at]
end
custom_id() click to toggle source

Refund ‘custom_id`. The value is being inherited from the parent invoice

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

Processing fee

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

Processing fee currency

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

Refund ID

# File lib/cryptopay/models/invoice_refund.rb, line 51
def id
  @attributes[:id]
end
inspect() click to toggle source
# File lib/cryptopay/models/invoice_refund.rb, line 150
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_refund.rb, line 106
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 "amount", amount cannot be nil.') if amount.nil?

  properties.push('invalid value for "amount_currency", amount_currency cannot be nil.') if amount_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?

  risk&.invalid_properties&.each do |prop|
    properties.push("invalid value for \"risk\": #{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_refund.rb, line 56
def invoice_id
  @attributes[:invoice_id]
end
risk() click to toggle source
# File lib/cryptopay/models/invoice_refund.rb, line 95
def risk
  @attributes[:risk]
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_refund.rb, line 146
def to_hash
  ENCODER.to_hash(@attributes)
end
txid() click to toggle source

Cryptocurrency transaction ID on the blockchain

# File lib/cryptopay/models/invoice_refund.rb, line 91
def txid
  @attributes[:txid]
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_refund.rb, line 132
def valid?
  invalid_properties.empty?
end