Class: Ingenico::Connect::SDK::Domain::Sessions::SessionRequest
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Sessions::SessionRequest
- Defined in:
- lib/ingenico/connect/sdk/domain/sessions/session_request.rb
Instance Attribute Summary collapse
- #payment_product_filters ⇒ Object
-
#tokens ⇒ Object
Array of String.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#payment_product_filters ⇒ Object
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 15 def payment_product_filters @payment_product_filters end |
#tokens ⇒ Object
Array of String
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 18 def tokens @tokens end |
Instance Method Details
#from_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 27 def from_hash(hash) super if hash.has_key?('paymentProductFilters') if !(hash['paymentProductFilters'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductFilters']] end @payment_product_filters = Ingenico::Connect::SDK::Domain::Sessions::PaymentProductFiltersClientSession.new_from_hash(hash['paymentProductFilters']) end if hash.has_key?('tokens') if !(hash['tokens'].is_a? Array) raise TypeError, "value '%s' is not an Array" % [hash['tokens']] end @tokens = [] hash['tokens'].each do |e| @tokens << e end end end |
#to_h ⇒ Object
20 21 22 23 24 25 |
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 20 def to_h hash = super add_to_hash(hash, 'paymentProductFilters', @payment_product_filters) add_to_hash(hash, 'tokens', @tokens) hash end |