Class: K2ConnectRuby::K2Services::Payloads::Transactions::PaymentLink

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb

Overview

Parsed attributes of payment link result callback

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ PaymentLink

Returns a new instance of PaymentLink.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 18

def initialize(payload)
  @id = payload.dig("data", "id")
  @type = payload.dig("data", "type")
  @status = payload.dig("data", "attributes", "status")
  @created_at = payload.dig("data", "attributes", "created_at")
  @till_name = payload.dig("data", "attributes", "till_name")
  @currency = payload.dig("data", "attributes", "currency")
  @amount = payload.dig("data", "attributes", "amount")
  @payment_reference = payload.dig("data", "attributes", "payment_reference")
  @note = payload.dig("data", "attributes", "note")
  @payment_link = payload.dig("data", "attributes", "payment_link")&.deep_symbolize_keys
  @metadata = payload.dig("data", "attributes", "metadata")&.deep_symbolize_keys
  @request_errors = payload.dig("data", "attributes", "errors")
  @callback_url = payload.dig("data", "attributes", "_links", "callback_url")
  @links_self = payload.dig("data", "attributes", "_links", "self")
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def amount
  @amount
end

#callback_urlObject (readonly)

Returns the value of attribute callback_url.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def callback_url
  @callback_url
end

#created_atObject (readonly)

Returns the value of attribute created_at.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def id
  @id
end

Returns the value of attribute links_self.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def links_self
  @links_self
end

#metadataObject (readonly)

Returns the value of attribute metadata.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def 
  @metadata
end

#noteObject (readonly)

Returns the value of attribute note.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def note
  @note
end

Returns the value of attribute payment_link.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def payment_link
  @payment_link
end

#payment_referenceObject (readonly)

Returns the value of attribute payment_reference.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def payment_reference
  @payment_reference
end

#request_errorsObject (readonly)

Returns the value of attribute request_errors.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def request_errors
  @request_errors
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def status
  @status
end

#till_nameObject (readonly)

Returns the value of attribute till_name.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def till_name
  @till_name
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/payment_link.rb', line 11

def type
  @type
end