Class: K2ConnectRuby::K2Services::Payloads::Transactions::Reversal

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

Overview

Parsed attributes of reversal result callback

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Reversal

Returns a new instance of Reversal.



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

def initialize(payload)
  @id = payload.dig("data", "id")
  @type = payload.dig("data", "type")
  @transaction_reference = payload.dig("data", "attributes", "transaction_reference")
  @status = payload.dig("data", "attributes", "status")
  @created_at = payload.dig("data", "attributes", "created_at")
  @reason = payload.dig("data", "attributes", "reason")
  @reversal_bulk_payment = payload.dig("data", "attributes", "reversal_bulk_payment")&.deep_symbolize_keys
  @metadata = payload.dig("data", "attributes", "metadata")&.deep_symbolize_keys
  @request_errors = payload.dig("data", "attributes", "errors")
  @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.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/reversal.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/reversal.rb', line 11

def created_at
  @created_at
end

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/k2-connect-ruby/k2_services/payloads/transactions/reversal.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/reversal.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/reversal.rb', line 11

def 
  @metadata
end

#reasonObject (readonly)

Returns the value of attribute reason.



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

def reason
  @reason
end

#request_errorsObject (readonly)

Returns the value of attribute request_errors.



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

def request_errors
  @request_errors
end

#reversal_bulk_paymentObject (readonly)

Returns the value of attribute reversal_bulk_payment.



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

def reversal_bulk_payment
  @reversal_bulk_payment
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#transaction_referenceObject (readonly)

Returns the value of attribute transaction_reference.



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

def transaction_reference
  @transaction_reference
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end