Class: OnlinePayments::SDK::Domain::SessionResponse

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/session_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#asset_urlString

Returns the current value of asset_url.

Returns:

  • (String)

    the current value of asset_url



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

def asset_url
  @asset_url
end

#client_api_urlString

Returns the current value of client_api_url.

Returns:

  • (String)

    the current value of client_api_url



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

def client_api_url
  @client_api_url
end

#client_session_idString

Returns the current value of client_session_id.

Returns:

  • (String)

    the current value of client_session_id



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

def client_session_id
  @client_session_id
end

#customer_idString

Returns the current value of customer_id.

Returns:

  • (String)

    the current value of customer_id



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

def customer_id
  @customer_id
end

#invalid_tokensArray<String>

Returns the current value of invalid_tokens.

Returns:

  • (Array<String>)

    the current value of invalid_tokens



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

def invalid_tokens
  @invalid_tokens
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  @asset_url = hash['assetUrl'] if hash.key? 'assetUrl'
  @client_api_url = hash['clientApiUrl'] if hash.key? 'clientApiUrl'
  @client_session_id = hash['clientSessionId'] if hash.key? 'clientSessionId'
  @customer_id = hash['customerId'] if hash.key? 'customerId'
  if hash.key? 'invalidTokens'
    raise TypeError, "value '%s' is not an Array" % [hash['invalidTokens']] unless hash['invalidTokens'].is_a? Array
    @invalid_tokens = []
    hash['invalidTokens'].each do |e|
      @invalid_tokens << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['assetUrl'] = @asset_url unless @asset_url.nil?
  hash['clientApiUrl'] = @client_api_url unless @client_api_url.nil?
  hash['clientSessionId'] = @client_session_id unless @client_session_id.nil?
  hash['customerId'] = @customer_id unless @customer_id.nil?
  hash['invalidTokens'] = @invalid_tokens unless @invalid_tokens.nil?
  hash
end