Class: K2ConnectRuby::K2Services::Payloads::OutgoingTransaction

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

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.



46
47
48
49
50
51
52
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 46

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.



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

def created_at
  @created_at
end

#total_valueObject (readonly)

Returns the value of attribute total_value.



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

def total_value
  @total_value
end

#transfer_batchesObject (readonly)

Returns the value of attribute transfer_batches.



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

def transfer_batches
  @transfer_batches
end