Class: DPay::TransactionRefund
- Inherits:
-
Object
- Object
- DPay::TransactionRefund
- Defined in:
- lib/dpay/payment/transaction_refund.rb,
sig/dpay/payment/transaction_refund.rbs
Instance Attribute Summary collapse
-
#creation_date ⇒ String?
readonly
Returns the value of attribute creation_date.
-
#payment_date ⇒ String?
readonly
Returns the value of attribute payment_date.
-
#payment_id ⇒ String
readonly
Returns the value of attribute payment_id.
-
#raw ⇒ Hash[String, untyped]
readonly
Returns the value of attribute raw.
-
#status ⇒ String
readonly
Returns the value of attribute status.
-
#value ⇒ Money
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ TransactionRefund
constructor
A new instance of TransactionRefund.
Constructor Details
#initialize(data) ⇒ TransactionRefund
Returns a new instance of TransactionRefund.
11 12 13 14 15 16 17 18 19 |
# File 'lib/dpay/payment/transaction_refund.rb', line 11 def initialize(data) @raw = data @payment_id = Internal::Coerce.string(data["payment_id"]) || "" @value = Internal::Coerce.money(data["value"]) @status = Internal::Coerce.string(data["status"]) || TransactionStatus::PAID @creation_date = Internal::Coerce.string(data["creation_date"]) @payment_date = Internal::Coerce.string(data["payment_date"]) freeze end |
Instance Attribute Details
#creation_date ⇒ String? (readonly)
Returns the value of attribute creation_date.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def creation_date @creation_date end |
#payment_date ⇒ String? (readonly)
Returns the value of attribute payment_date.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def payment_date @payment_date end |
#payment_id ⇒ String (readonly)
Returns the value of attribute payment_id.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def payment_id @payment_id end |
#raw ⇒ Hash[String, untyped] (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def raw @raw end |
#status ⇒ String (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def status @status end |
#value ⇒ Money (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/dpay/payment/transaction_refund.rb', line 5 def value @value end |
Class Method Details
.from_api(data) ⇒ TransactionRefund
7 8 9 |
# File 'lib/dpay/payment/transaction_refund.rb', line 7 def self.from_api(data) new(data) end |