Class: CommonPayment
- Inherits:
-
K2Transaction
- Object
- K2Transaction
- CommonPayment
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#initiation_time ⇒ Object
readonly
Returns the value of attribute initiation_time.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from K2Transaction
#callback_url, #id, #links_self, #metadata, #type
Instance Method Summary collapse
-
#initialize(payload) ⇒ CommonPayment
constructor
A new instance of CommonPayment.
Constructor Details
#initialize(payload) ⇒ CommonPayment
Returns a new instance of CommonPayment.
25 26 27 28 29 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 25 def initialize(payload) super @status = payload.dig('data', 'attributes', 'status') @initiation_time = payload.dig('data', 'attributes', 'initiation_time') if @type.eql?('incoming_payment') end |
Instance Attribute Details
#initiation_time ⇒ Object (readonly)
Returns the value of attribute initiation_time.
20 21 22 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 20 def initiation_time @initiation_time end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20 21 22 |
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 20 def status @status end |