Class: OnlinePayments::SDK::Domain::SessionResponse
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::SessionResponse
- Defined in:
- lib/onlinepayments/sdk/domain/session_response.rb
Instance Attribute Summary collapse
-
#asset_url ⇒ String
The current value of asset_url.
-
#client_api_url ⇒ String
The current value of client_api_url.
-
#client_session_id ⇒ String
The current value of client_session_id.
-
#customer_id ⇒ String
The current value of customer_id.
-
#invalid_tokens ⇒ Array<String>
The current value of invalid_tokens.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#asset_url ⇒ String
Returns 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_url ⇒ String
Returns 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_id ⇒ String
Returns 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_id ⇒ String
Returns 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_tokens ⇒ Array<String>
Returns 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_h ⇒ 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 |