Class: OnlinePayments::SDK::Domain::PaymentProduct
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentProduct
- Defined in:
- lib/onlinepayments/sdk/domain/payment_product.rb
Instance Attribute Summary collapse
-
#accounts_on_file ⇒ Array<OnlinePayments::SDK::Domain::AccountOnFile>
The current value of accounts_on_file.
-
#allows_authentication ⇒ true/false
The current value of allows_authentication.
-
#allows_recurring ⇒ true/false
The current value of allows_recurring.
-
#allows_tokenization ⇒ true/false
The current value of allows_tokenization.
-
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductDisplayHints
The current value of display_hints.
-
#display_hints_list ⇒ Array<OnlinePayments::SDK::Domain::PaymentProductDisplayHints>
The current value of display_hints_list.
-
#fields ⇒ Array<OnlinePayments::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_product302_specific_data ⇒ OnlinePayments::SDK::Domain::PaymentProduct302SpecificData
The current value of payment_product302_specific_data.
-
#payment_product320_specific_data ⇒ OnlinePayments::SDK::Domain::PaymentProduct320SpecificData
The current value of payment_product320_specific_data.
-
#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 DataObject
Instance Attribute Details
#accounts_on_file ⇒ Array<OnlinePayments::SDK::Domain::AccountOnFile>
Returns the current value of accounts_on_file.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def accounts_on_file @accounts_on_file end |
#allows_authentication ⇒ true/false
Returns the current value of allows_authentication.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def allows_authentication @allows_authentication end |
#allows_recurring ⇒ true/false
Returns the current value of allows_recurring.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def allows_recurring @allows_recurring end |
#allows_tokenization ⇒ true/false
Returns the current value of allows_tokenization.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def allows_tokenization @allows_tokenization end |
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductDisplayHints
Returns the current value of display_hints.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def display_hints @display_hints end |
#display_hints_list ⇒ Array<OnlinePayments::SDK::Domain::PaymentProductDisplayHints>
Returns the current value of display_hints_list.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def display_hints_list @display_hints_list end |
#fields ⇒ Array<OnlinePayments::SDK::Domain::PaymentProductField>
Returns the current value of fields.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def fields @fields end |
#id ⇒ Integer
Returns the current value of id.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def id @id end |
#payment_method ⇒ String
Returns the current value of payment_method.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def payment_method @payment_method end |
#payment_product302_specific_data ⇒ OnlinePayments::SDK::Domain::PaymentProduct302SpecificData
Returns the current value of payment_product302_specific_data.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def payment_product302_specific_data @payment_product302_specific_data end |
#payment_product320_specific_data ⇒ OnlinePayments::SDK::Domain::PaymentProduct320SpecificData
Returns the current value of payment_product320_specific_data.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def payment_product320_specific_data @payment_product320_specific_data end |
#payment_product_group ⇒ String
Returns the current value of payment_product_group.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 def payment_product_group @payment_product_group end |
#uses_redirection_to3rd_party ⇒ true/false
Returns the current value of uses_redirection_to3rd_party.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 27 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/onlinepayments/sdk/domain/payment_product.rb', line 74 def from_hash(hash) super if hash.has_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 << OnlinePayments::SDK::Domain::AccountOnFile.new_from_hash(e) end end if hash.has_key? 'allowsAuthentication' @allows_authentication = hash['allowsAuthentication'] 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? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = OnlinePayments::SDK::Domain::PaymentProductDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key? 'displayHintsList' raise TypeError, "value '%s' is not an Array" % [hash['displayHintsList']] unless hash['displayHintsList'].is_a? Array @display_hints_list = [] hash['displayHintsList'].each do |e| @display_hints_list << OnlinePayments::SDK::Domain::PaymentProductDisplayHints.new_from_hash(e) end end if hash.has_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 << OnlinePayments::SDK::Domain::PaymentProductField.new_from_hash(e) end end if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'paymentMethod' @payment_method = hash['paymentMethod'] end if hash.has_key? 'paymentProduct302SpecificData' raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct302SpecificData']] unless hash['paymentProduct302SpecificData'].is_a? Hash @payment_product302_specific_data = OnlinePayments::SDK::Domain::PaymentProduct302SpecificData.new_from_hash(hash['paymentProduct302SpecificData']) end if hash.has_key? 'paymentProduct320SpecificData' raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct320SpecificData']] unless hash['paymentProduct320SpecificData'].is_a? Hash @payment_product320_specific_data = OnlinePayments::SDK::Domain::PaymentProduct320SpecificData.new_from_hash(hash['paymentProduct320SpecificData']) 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_h ⇒ Hash
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/onlinepayments/sdk/domain/payment_product.rb', line 56 def to_h hash = super hash['accountsOnFile'] = @accounts_on_file.collect{|val| val.to_h} unless @accounts_on_file.nil? hash['allowsAuthentication'] = @allows_authentication unless @allows_authentication.nil? hash['allowsRecurring'] = @allows_recurring unless @allows_recurring.nil? hash['allowsTokenization'] = @allows_tokenization unless @allows_tokenization.nil? hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? hash['displayHintsList'] = @display_hints_list.collect{|val| val.to_h} unless @display_hints_list.nil? hash['fields'] = @fields.collect{|val| val.to_h} unless @fields.nil? hash['id'] = @id unless @id.nil? hash['paymentMethod'] = @payment_method unless @payment_method.nil? hash['paymentProduct302SpecificData'] = @payment_product302_specific_data.to_h unless @payment_product302_specific_data.nil? hash['paymentProduct320SpecificData'] = @payment_product320_specific_data.to_h unless @payment_product320_specific_data.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 |