Class: CommonPayment

Inherits:
K2Transaction show all
Includes:
ActiveModel::Validations
Defined in:
lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb

Direct Known Subclasses

IncomingPayments, OutgoingTransaction

Instance Attribute Summary collapse

Attributes inherited from K2Transaction

#callback_url, #id, #links_self, #metadata, #type

Instance Method Summary collapse

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_timeObject (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

#statusObject (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