Class: Ingenico::Direct::SDK::Domain::PaymentProductGroup

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/payment_product_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#account_on_fileIngenico::Direct::SDK::Domain::AccountOnFile

Returns the current value of account_on_file.

Returns:



15
16
17
# File 'lib/ingenico/direct/sdk/domain/payment_product_group.rb', line 15

def 
  @account_on_file
end

#display_hintsIngenico::Direct::SDK::Domain::PaymentProductDisplayHints

Returns the current value of display_hints.

Returns:



15
16
17
# File 'lib/ingenico/direct/sdk/domain/payment_product_group.rb', line 15

def display_hints
  @display_hints
end

#idString

Returns the current value of id.

Returns:

  • (String)

    the current value of id



15
16
17
# File 'lib/ingenico/direct/sdk/domain/payment_product_group.rb', line 15

def id
  @id
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ingenico/direct/sdk/domain/payment_product_group.rb', line 29

def from_hash(hash)
  super
  if hash.key? 'accountOnFile'
    raise TypeError, "value '%s' is not a Hash" % [hash['accountOnFile']] unless hash['accountOnFile'].is_a? Hash
    @account_on_file = Ingenico::Direct::SDK::Domain::AccountOnFile.new_from_hash(hash['accountOnFile'])
  end
  if hash.key? 'displayHints'
    raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
    @display_hints = Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints.new_from_hash(hash['displayHints'])
  end
  @id = hash['id'] if hash.key? 'id'
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/ingenico/direct/sdk/domain/payment_product_group.rb', line 21

def to_h
  hash = super
  hash['accountOnFile'] = @account_on_file.to_h if @account_on_file
  hash['displayHints'] = @display_hints.to_h if @display_hints
  hash['id'] = @id unless @id.nil?
  hash
end