Class: OnlinePayments::SDK::Domain::GetHostedFieldsSessionResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#session_idString

Returns the current value of session_id.

Returns:

  • (String)

    the current value of session_id



12
13
14
# File 'lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb', line 12

def session_id
  @session_id
end

#tokenOnlinePayments::SDK::Domain::TokenInfo

Returns the current value of token.

Returns:



12
13
14
# File 'lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb', line 12

def token
  @token
end

Instance Method Details

#from_hash(hash) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb', line 26

def from_hash(hash)
  super
  if hash.has_key? 'sessionId'
    @session_id = hash['sessionId']
  end
  if hash.has_key? 'token'
    raise TypeError, "value '%s' is not a Hash" % [hash['token']] unless hash['token'].is_a? Hash
    @token = OnlinePayments::SDK::Domain::TokenInfo.new_from_hash(hash['token'])
  end
end

#to_hHash

Returns:

  • (Hash)


19
20
21
22
23
24
# File 'lib/onlinepayments/sdk/domain/get_hosted_fields_session_response.rb', line 19

def to_h
  hash = super
  hash['sessionId'] = @session_id unless @session_id.nil?
  hash['token'] = @token.to_h unless @token.nil?
  hash
end