Class: OnlinePayments::SDK::Domain::GetHostedTokenizationResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#tokenOnlinePayments::SDK::Domain::TokenResponse

Returns the current value of token.

Returns:



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

def token
  @token
end

#token_statusString

Returns the current value of token_status.

Returns:

  • (String)

    the current value of token_status



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

def token_status
  @token_status
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_tokenization_response.rb', line 26

def from_hash(hash)
  super
  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::TokenResponse.new_from_hash(hash['token'])
  end
  if hash.has_key? 'tokenStatus'
    @token_status = hash['tokenStatus']
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['token'] = @token.to_h unless @token.nil?
  hash['tokenStatus'] = @token_status unless @token_status.nil?
  hash
end