Class: Ingenico::Direct::SDK::Domain::PaymentProduct
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::PaymentProduct
- Defined in:
- lib/ingenico/direct/sdk/domain/payment_product.rb
Instance Attribute Summary collapse
-
#accounts_on_file ⇒ Array<Ingenico::Direct::SDK::Domain::AccountOnFile>
The current value of accounts_on_file.
-
#allows_recurring ⇒ true/false
The current value of allows_recurring.
-
#allows_tokenization ⇒ true/false
The current value of allows_tokenization.
-
#display_hints ⇒ Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints
The current value of display_hints.
-
#fields ⇒ Array<Ingenico::Direct::SDK::Domain::PaymentProductField>
The current value of fields.
-
#id ⇒ Integer
The current value of id.
-
#payment_method ⇒ String
The current value of payment_method.
-
#payment_product_group ⇒ String
The current value of payment_product_group.
-
#uses_redirection_to3rd_party ⇒ true/false
The current value of uses_redirection_to3rd_party.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#accounts_on_file ⇒ Array<Ingenico::Direct::SDK::Domain::AccountOnFile>
Returns the current value of accounts_on_file.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def accounts_on_file @accounts_on_file end |
#allows_recurring ⇒ true/false
Returns the current value of allows_recurring.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def allows_recurring @allows_recurring end |
#allows_tokenization ⇒ true/false
Returns the current value of allows_tokenization.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def allows_tokenization @allows_tokenization end |
#display_hints ⇒ Ingenico::Direct::SDK::Domain::PaymentProductDisplayHints
Returns the current value of display_hints.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def display_hints @display_hints end |
#fields ⇒ Array<Ingenico::Direct::SDK::Domain::PaymentProductField>
Returns the current value of fields.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def fields @fields end |
#id ⇒ Integer
Returns the current value of id.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def id @id end |
#payment_method ⇒ String
Returns the current value of payment_method.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def payment_method @payment_method end |
#payment_product_group ⇒ String
Returns the current value of payment_product_group.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def payment_product_group @payment_product_group end |
#uses_redirection_to3rd_party ⇒ true/false
Returns the current value of uses_redirection_to3rd_party.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 22 def uses_redirection_to3rd_party @uses_redirection_to3rd_party end |
Instance Method Details
#from_hash(hash) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 48 def from_hash(hash) super if hash.key? 'accountsOnFile' raise TypeError, "value '%s' is not an Array" % [hash['accountsOnFile']] unless hash['accountsOnFile'].is_a? Array @accounts_on_file = [] hash['accountsOnFile'].each do |e| @accounts_on_file << Ingenico::Direct::SDK::Domain::AccountOnFile.new_from_hash(e) end end @allows_recurring = hash['allowsRecurring'] if hash.key? 'allowsRecurring' @allows_tokenization = hash['allowsTokenization'] if hash.key? 'allowsTokenization' 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 if hash.key? 'fields' raise TypeError, "value '%s' is not an Array" % [hash['fields']] unless hash['fields'].is_a? Array @fields = [] hash['fields'].each do |e| @fields << Ingenico::Direct::SDK::Domain::PaymentProductField.new_from_hash(e) end end @id = hash['id'] if hash.key? 'id' @payment_method = hash['paymentMethod'] if hash.key? 'paymentMethod' @payment_product_group = hash['paymentProductGroup'] if hash.key? 'paymentProductGroup' @uses_redirection_to3rd_party = hash['usesRedirectionTo3rdParty'] if hash.key? 'usesRedirectionTo3rdParty' end |
#to_h ⇒ Hash
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ingenico/direct/sdk/domain/payment_product.rb', line 34 def to_h hash = super hash['accountsOnFile'] = @accounts_on_file.collect(&:to_h) if @accounts_on_file hash['allowsRecurring'] = @allows_recurring unless @allows_recurring.nil? hash['allowsTokenization'] = @allows_tokenization unless @allows_tokenization.nil? hash['displayHints'] = @display_hints.to_h if @display_hints hash['fields'] = @fields.collect(&:to_h) if @fields hash['id'] = @id unless @id.nil? hash['paymentMethod'] = @payment_method unless @payment_method.nil? hash['paymentProductGroup'] = @payment_product_group unless @payment_product_group.nil? hash['usesRedirectionTo3rdParty'] = @uses_redirection_to3rd_party unless @uses_redirection_to3rd_party.nil? hash end |