Class: Worldline::Acquiring::SDK::V1::Domain::ApiReversalResponse

Inherits:
ApiActionResponse show all
Defined in:
lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb

Instance Attribute Summary collapse

Attributes inherited from ApiActionResponse

#operation_id, #payment, #responder, #response_code, #response_code_category, #response_code_description

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#total_authorized_amountWorldline::Acquiring::SDK::V1::Domain::AmountData

Returns the current value of total_authorized_amount.

Returns:



13
14
15
# File 'lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb', line 13

def total_authorized_amount
  @total_authorized_amount
end

Instance Method Details

#from_hash(hash) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb', line 24

def from_hash(hash)
  super
  if hash.has_key? 'totalAuthorizedAmount'
    raise TypeError, "value '%s' is not a Hash" % [hash['totalAuthorizedAmount']] unless hash['totalAuthorizedAmount'].is_a? Hash
    @total_authorized_amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['totalAuthorizedAmount'])
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
# File 'lib/worldline/acquiring/sdk/v1/domain/api_reversal_response.rb', line 18

def to_h
  hash = super
  hash['totalAuthorizedAmount'] = @total_authorized_amount.to_h unless @total_authorized_amount.nil?
  hash
end