class Ingenico::Direct::SDK::Domain::RedirectPaymentMethodSpecificInput

@attr [String] payment_option @attr [Ingenico::Direct::SDK::Domain::RedirectPaymentProduct809SpecificInput] payment_product809_specific_input @attr [Ingenico::Direct::SDK::Domain::RedirectPaymentProduct840SpecificInput] payment_product840_specific_input @attr [Integer] payment_product_id @attr [Ingenico::Direct::SDK::Domain::RedirectionData] redirection_data @attr [true/false] requires_approval @attr [String] token @attr [true/false] tokenize

Attributes

payment_option[RW]
payment_product809_specific_input[RW]
payment_product840_specific_input[RW]
payment_product_id[RW]
redirection_data[RW]
requires_approval[RW]
token[RW]
tokenize[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/redirect_payment_method_specific_input.rb, line 45
def from_hash(hash)
  super
  @payment_option = hash['paymentOption'] if hash.key? 'paymentOption'
  if hash.key? 'paymentProduct809SpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct809SpecificInput']] unless hash['paymentProduct809SpecificInput'].is_a? Hash
    @payment_product809_specific_input = Ingenico::Direct::SDK::Domain::RedirectPaymentProduct809SpecificInput.new_from_hash(hash['paymentProduct809SpecificInput'])
  end
  if hash.key? 'paymentProduct840SpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['paymentProduct840SpecificInput']] unless hash['paymentProduct840SpecificInput'].is_a? Hash
    @payment_product840_specific_input = Ingenico::Direct::SDK::Domain::RedirectPaymentProduct840SpecificInput.new_from_hash(hash['paymentProduct840SpecificInput'])
  end
  @payment_product_id = hash['paymentProductId'] if hash.key? 'paymentProductId'
  if hash.key? 'redirectionData'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectionData']] unless hash['redirectionData'].is_a? Hash
    @redirection_data = Ingenico::Direct::SDK::Domain::RedirectionData.new_from_hash(hash['redirectionData'])
  end
  @requires_approval = hash['requiresApproval'] if hash.key? 'requiresApproval'
  @token = hash['token'] if hash.key? 'token'
  @tokenize = hash['tokenize'] if hash.key? 'tokenize'
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/redirect_payment_method_specific_input.rb, line 32
def to_h
  hash = super
  hash['paymentOption'] = @payment_option unless @payment_option.nil?
  hash['paymentProduct809SpecificInput'] = @payment_product809_specific_input.to_h if @payment_product809_specific_input
  hash['paymentProduct840SpecificInput'] = @payment_product840_specific_input.to_h if @payment_product840_specific_input
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash['redirectionData'] = @redirection_data.to_h if @redirection_data
  hash['requiresApproval'] = @requires_approval unless @requires_approval.nil?
  hash['token'] = @token unless @token.nil?
  hash['tokenize'] = @tokenize unless @tokenize.nil?
  hash
end