Class: OnlinePayments::SDK::Domain::CurrencyConversionResponse

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/currency_conversion_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#dcc_session_idString

Returns the current value of dcc_session_id.

Returns:

  • (String)

    the current value of dcc_session_id



14
15
16
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14

def dcc_session_id
  @dcc_session_id
end

#proposalOnlinePayments::SDK::Domain::DccProposal

Returns the current value of proposal.

Returns:



14
15
16
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14

def proposal
  @proposal
end

#resultOnlinePayments::SDK::Domain::CurrencyConversionResult

Returns the current value of result.

Returns:



14
15
16
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 14

def result
  @result
end

Instance Method Details

#from_hash(hash) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 31

def from_hash(hash)
  super
  if hash.has_key? 'dccSessionId'
    @dcc_session_id = hash['dccSessionId']
  end
  if hash.has_key? 'proposal'
    raise TypeError, "value '%s' is not a Hash" % [hash['proposal']] unless hash['proposal'].is_a? Hash
    @proposal = OnlinePayments::SDK::Domain::DccProposal.new_from_hash(hash['proposal'])
  end
  if hash.has_key? 'result'
    raise TypeError, "value '%s' is not a Hash" % [hash['result']] unless hash['result'].is_a? Hash
    @result = OnlinePayments::SDK::Domain::CurrencyConversionResult.new_from_hash(hash['result'])
  end
end

#to_hHash

Returns:

  • (Hash)


23
24
25
26
27
28
29
# File 'lib/onlinepayments/sdk/domain/currency_conversion_response.rb', line 23

def to_h
  hash = super
  hash['dccSessionId'] = @dcc_session_id unless @dcc_session_id.nil?
  hash['proposal'] = @proposal.to_h unless @proposal.nil?
  hash['result'] = @result.to_h unless @result.nil?
  hash
end