Class: K2ConnectRuby::K2Services::Payloads::K2Transaction

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

Direct Known Subclasses

CommonPayment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ K2Transaction

Returns a new instance of K2Transaction.



13
14
15
16
17
18
19
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 13

def initialize(payload)
  @id = payload.dig("data", "id")
  @type = payload.dig("data", "type")
  @metadata = payload.dig("data", "attributes", "metadata")
  @links_self = payload.dig("data", "attributes", "_links", "self")
  @callback_url = payload.dig("data", "attributes", "_links", "callback_url")
end

Instance Attribute Details

#callback_urlObject (readonly)

Returns the value of attribute callback_url.



7
8
9
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 7

def callback_url
  @callback_url
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 7

def id
  @id
end

Returns the value of attribute links_self.



7
8
9
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 7

def links_self
  @links_self
end

#metadataObject (readonly)

Returns the value of attribute metadata.



7
8
9
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 7

def 
  @metadata
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 7

def type
  @type
end