Class: K2ConnectRuby::K2Entity::K2FinancialEntities::Reversals::ReversalRequest

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb

Overview

Request to initiate a reversal

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kwargs) ⇒ ReversalRequest

Returns a new instance of ReversalRequest.



15
16
17
18
19
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 15

def initialize(kwargs)
  kwargs.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#callback_urlObject

Returns the value of attribute callback_url.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 11

def callback_url
  @callback_url
end

#metadataObject

Returns the value of attribute metadata.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 11

def 
  @metadata
end

#reasonObject

Returns the value of attribute reason.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 11

def reason
  @reason
end

#transaction_referenceObject

Returns the value of attribute transaction_reference.



11
12
13
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 11

def transaction_reference
  @transaction_reference
end

Instance Method Details

#endpointObject



32
33
34
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 32

def endpoint
  K2ConnectRuby::K2Utilities::Config::K2Config.endpoint("reversals")
end

#request_bodyObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/k2-connect-ruby/k2_entity/k2_financial_entities/reversals/reversal_request.rb', line 21

def request_body
  {
    transaction_reference: transaction_reference,
    reason: reason,
    metadata: ,
    _links: {
      callback_url: callback_url
    }
  }
end