Class: Cryptopay::InvoiceRefund
- Inherits:
-
Object
- Object
- Cryptopay::InvoiceRefund
- Defined in:
- lib/cryptopay/models/invoice_refund.rb
Class Method Summary collapse
-
.build_from_hash(data) ⇒ Cryptopay::InvoiceRefund
Builds the object from hash.
Instance Method Summary collapse
-
#address ⇒ Object
Cryptocurrency address the refund transaction sent to.
-
#amount ⇒ Object
Refund amount.
-
#amount_currency ⇒ Object
Refund currency.
-
#created_at ⇒ Object
Refund transaction creation date and time.
-
#custom_id ⇒ Object
Refund ‘custom_id`.
-
#fee ⇒ Object
Processing fee.
-
#fee_currency ⇒ Object
Processing fee currency.
-
#id ⇒ Object
Refund ID.
-
#initialize(attributes = {}) ⇒ InvoiceRefund
constructor
Initializes the object.
- #inspect ⇒ Object
-
#invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#invoice_id ⇒ Object
Invoice ID.
-
#network ⇒ Object
Cryptocurrency network.
- #risk ⇒ Object
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#txid ⇒ Object
Cryptocurrency transaction ID on the blockchain.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ InvoiceRefund
Initializes the object
56 57 58 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 56 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end |
Class Method Details
.build_from_hash(data) ⇒ Cryptopay::InvoiceRefund
Builds the object from hash
49 50 51 52 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 49 def self.build_from_hash(data) attributes = ENCODER.build_from_hash(data) new(attributes) end |
Instance Method Details
#address ⇒ Object
Cryptocurrency address the refund transaction sent to
96 97 98 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 96 def address @attributes[:address] end |
#amount ⇒ Object
Refund amount
76 77 78 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 76 def amount @attributes[:amount] end |
#amount_currency ⇒ Object
Refund currency
81 82 83 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 81 def amount_currency @attributes[:amount_currency] end |
#created_at ⇒ Object
Refund transaction creation date and time
115 116 117 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 115 def created_at @attributes[:created_at] end |
#custom_id ⇒ Object
Refund ‘custom_id`. The value is being inherited from the parent invoice
71 72 73 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 71 def custom_id @attributes[:custom_id] end |
#fee ⇒ Object
Processing fee
86 87 88 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 86 def fee @attributes[:fee] end |
#fee_currency ⇒ Object
Processing fee currency
91 92 93 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 91 def fee_currency @attributes[:fee_currency] end |
#id ⇒ Object
Refund ID
61 62 63 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 61 def id @attributes[:id] end |
#inspect ⇒ Object
159 160 161 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 159 def inspect "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash) end |
#invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 121 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? properties.push('invalid value for "network", network cannot be nil.') if network.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 ⇒ Object
Invoice ID
66 67 68 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 66 def invoice_id @attributes[:invoice_id] end |
#network ⇒ Object
Cryptocurrency network
101 102 103 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 101 def network @attributes[:network] end |
#risk ⇒ Object
110 111 112 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 110 def risk @attributes[:risk] end |
#to_hash ⇒ Hash
Returns the object in the form of hash
155 156 157 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 155 def to_hash ENCODER.to_hash(@attributes) end |
#txid ⇒ Object
Cryptocurrency transaction ID on the blockchain
106 107 108 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 106 def txid @attributes[:txid] end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
149 150 151 |
# File 'lib/cryptopay/models/invoice_refund.rb', line 149 def valid? invalid_properties.empty? end |