Class: Ingenico::Connect::SDK::Domain::Sessions::SessionRequest

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/sessions/session_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#payment_product_filtersIngenico::Connect::SDK::Domain::Sessions::PaymentProductFiltersClientSession

Returns the current value of payment_product_filters.

Returns:



15
16
17
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 15

def payment_product_filters
  @payment_product_filters
end

#tokensArray<String>

Returns the current value of tokens.

Returns:

  • (Array<String>)

    the current value of tokens



15
16
17
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 15

def tokens
  @tokens
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 29

def from_hash(hash)
  super
  if hash.has_key? 'paymentProductFilters'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentProductFilters']] unless hash['paymentProductFilters'].is_a? Hash
    @payment_product_filters = Ingenico::Connect::SDK::Domain::Sessions::PaymentProductFiltersClientSession.new_from_hash(hash['paymentProductFilters'])
  end
  if hash.has_key? 'tokens'
    raise TypeError, "value '%s' is not an Array" % [hash['tokens']] unless hash['tokens'].is_a? Array
    @tokens = []
    hash['tokens'].each do |e|
      @tokens << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


22
23
24
25
26
27
# File 'lib/ingenico/connect/sdk/domain/sessions/session_request.rb', line 22

def to_h
  hash = super
  hash['paymentProductFilters'] = @payment_product_filters.to_h unless @payment_product_filters.nil?
  hash['tokens'] = @tokens unless @tokens.nil?
  hash
end