Class: OutgoingTransaction

Inherits:
CommonPayment show all
Defined in:
lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb

Direct Known Subclasses

OutgoingPayment, Transfer

Instance Attribute Summary collapse

Attributes inherited from CommonPayment

#initiation_time, #status

Attributes inherited from K2Transaction

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

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ OutgoingTransaction

Returns a new instance of OutgoingTransaction.



41
42
43
44
45
46
47
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 41

def initialize(payload)
  super
  @created_at = payload.dig('data', 'attributes', 'created_at')
  @currency = payload.dig('data', 'attributes', 'amount', 'currency')
  @total_value = payload.dig('data', 'attributes', 'amount', 'value')
  @transfer_batches = payload.dig('data', 'attributes', 'transfer_batches')
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



37
38
39
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 37

def created_at
  @created_at
end

#total_valueObject (readonly)

Returns the value of attribute total_value.



37
38
39
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 37

def total_value
  @total_value
end

#transfer_batchesObject (readonly)

Returns the value of attribute transfer_batches.



37
38
39
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 37

def transfer_batches
  @transfer_batches
end