Class: Ingenico::Connect::SDK::Domain::Product::PaymentProduct

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

Overview

Direct Known Subclasses

PaymentProductResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#accounts_on_fileObject

Array of AccountOnFile



18
19
20
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 18

def accounts_on_file
  @accounts_on_file
end

#allows_recurringObject

true/false



21
22
23
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 21

def allows_recurring
  @allows_recurring
end

#allows_tokenizationObject

true/false



24
25
26
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 24

def allows_tokenization
  @allows_tokenization
end

#auto_tokenizedObject

true/false



27
28
29
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 27

def auto_tokenized
  @auto_tokenized
end

#display_hintsObject



30
31
32
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 30

def display_hints
  @display_hints
end

#fieldsObject



33
34
35
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 33

def fields
  @fields
end

#idObject

Integer



36
37
38
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 36

def id
  @id
end

#max_amountObject

Integer



39
40
41
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 39

def max_amount
  @max_amount
end

#min_amountObject

Integer



42
43
44
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 42

def min_amount
  @min_amount
end

#mobile_integration_levelObject

String



45
46
47
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 45

def mobile_integration_level
  @mobile_integration_level
end

#payment_methodObject

String



48
49
50
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 48

def payment_method
  @payment_method
end

#payment_product_groupObject

String



51
52
53
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 51

def payment_product_group
  @payment_product_group
end

#uses_redirection_to3rd_partyObject

true/false



54
55
56
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 54

def uses_redirection_to3rd_party
  @uses_redirection_to3rd_party
end

Instance Method Details

#from_hash(hash) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 74

def from_hash(hash)
  super
  if hash.has_key?('accountsOnFile')
    if !(hash['accountsOnFile'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['accountsOnFile']]
    end
    @accounts_on_file = []
    hash['accountsOnFile'].each do |e|
      @accounts_on_file << Ingenico::Connect::SDK::Domain::Product::AccountOnFile.new_from_hash(e)
    end
  end
  if hash.has_key?('allowsRecurring')
    @allows_recurring = hash['allowsRecurring']
  end
  if hash.has_key?('allowsTokenization')
    @allows_tokenization = hash['allowsTokenization']
  end
  if hash.has_key?('autoTokenized')
    @auto_tokenized = hash['autoTokenized']
  end
  if hash.has_key?('displayHints')
    if !(hash['displayHints'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']]
    end
    @display_hints = Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints.new_from_hash(hash['displayHints'])
  end
  if hash.has_key?('fields')
    if !(hash['fields'].is_a? Array)
      raise TypeError, "value '%s' is not an Array" % [hash['fields']]
    end
    @fields = []
    hash['fields'].each do |e|
      @fields << Ingenico::Connect::SDK::Domain::Product::PaymentProductField.new_from_hash(e)
    end
  end
  if hash.has_key?('id')
    @id = hash['id']
  end
  if hash.has_key?('maxAmount')
    @max_amount = hash['maxAmount']
  end
  if hash.has_key?('minAmount')
    @min_amount = hash['minAmount']
  end
  if hash.has_key?('mobileIntegrationLevel')
    @mobile_integration_level = hash['mobileIntegrationLevel']
  end
  if hash.has_key?('paymentMethod')
    @payment_method = hash['paymentMethod']
  end
  if hash.has_key?('paymentProductGroup')
    @payment_product_group = hash['paymentProductGroup']
  end
  if hash.has_key?('usesRedirectionTo3rdParty')
    @uses_redirection_to3rd_party = hash['usesRedirectionTo3rdParty']
  end
end

#to_hObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/ingenico/connect/sdk/domain/product/payment_product.rb', line 56

def to_h
  hash = super
  add_to_hash(hash, 'accountsOnFile', @accounts_on_file)
  add_to_hash(hash, 'allowsRecurring', @allows_recurring)
  add_to_hash(hash, 'allowsTokenization', @allows_tokenization)
  add_to_hash(hash, 'autoTokenized', @auto_tokenized)
  add_to_hash(hash, 'displayHints', @display_hints)
  add_to_hash(hash, 'fields', @fields)
  add_to_hash(hash, 'id', @id)
  add_to_hash(hash, 'maxAmount', @max_amount)
  add_to_hash(hash, 'minAmount', @min_amount)
  add_to_hash(hash, 'mobileIntegrationLevel', @mobile_integration_level)
  add_to_hash(hash, 'paymentMethod', @payment_method)
  add_to_hash(hash, 'paymentProductGroup', @payment_product_group)
  add_to_hash(hash, 'usesRedirectionTo3rdParty', @uses_redirection_to3rd_party)
  hash
end