Class: 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.



8
9
10
11
12
13
14
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 8

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.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2

def callback_url
  @callback_url
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2

def id
  @id
end

Returns the value of attribute links_self.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2

def links_self
  @links_self
end

#metadataObject (readonly)

Returns the value of attribute metadata.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2

def 
  @metadata
end

#typeObject (readonly)

Returns the value of attribute type.



2
3
4
# File 'lib/k2-connect-ruby/k2_services/payloads/k2_transaction.rb', line 2

def type
  @type
end