class Cryptopay::InvoiceRefund
Constants
- ENCODER
Public Class Methods
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
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
Cryptocurrency address the refund transaction sent to
# File lib/cryptopay/models/invoice_refund.rb, line 86 def address @attributes[:address] end
Refund amount
# File lib/cryptopay/models/invoice_refund.rb, line 66 def amount @attributes[:amount] end
Refund currency
# File lib/cryptopay/models/invoice_refund.rb, line 71 def amount_currency @attributes[:amount_currency] end
Refund transaction creation date and time
# File lib/cryptopay/models/invoice_refund.rb, line 100 def created_at @attributes[:created_at] end
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
Processing fee
# File lib/cryptopay/models/invoice_refund.rb, line 76 def fee @attributes[:fee] end
Processing fee currency
# File lib/cryptopay/models/invoice_refund.rb, line 81 def fee_currency @attributes[:fee_currency] end
Refund ID
# File lib/cryptopay/models/invoice_refund.rb, line 51 def id @attributes[:id] end
# 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
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
# File lib/cryptopay/models/invoice_refund.rb, line 56 def invoice_id @attributes[:invoice_id] end
# File lib/cryptopay/models/invoice_refund.rb, line 95 def risk @attributes[:risk] end
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
Cryptocurrency transaction ID on the blockchain
# File lib/cryptopay/models/invoice_refund.rb, line 91 def txid @attributes[:txid] 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_refund.rb, line 132 def valid? invalid_properties.empty? end