class Ingenico::Direct::SDK::Domain::CreateHostedCheckoutRequest

@attr [Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificInputBase] card_payment_method_specific_input @attr [Ingenico::Direct::SDK::Domain::FraudFields] fraud_fields @attr [Ingenico::Direct::SDK::Domain::HostedCheckoutSpecificInput] hosted_checkout_specific_input @attr [Ingenico::Direct::SDK::Domain::MobilePaymentMethodHostedCheckoutSpecificInput] mobile_payment_method_specific_input @attr [Ingenico::Direct::SDK::Domain::Order] order @attr [Ingenico::Direct::SDK::Domain::RedirectPaymentMethodSpecificInput] redirect_payment_method_specific_input

Attributes

card_payment_method_specific_input[RW]
fraud_fields[RW]
hosted_checkout_specific_input[RW]
mobile_payment_method_specific_input[RW]
order[RW]
redirect_payment_method_specific_input[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/create_hosted_checkout_request.rb, line 42
def from_hash(hash)
  super
  if hash.key? 'cardPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificInput']] unless hash['cardPaymentMethodSpecificInput'].is_a? Hash
    @card_payment_method_specific_input = Ingenico::Direct::SDK::Domain::CardPaymentMethodSpecificInputBase.new_from_hash(hash['cardPaymentMethodSpecificInput'])
  end
  if hash.key? 'fraudFields'
    raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']] unless hash['fraudFields'].is_a? Hash
    @fraud_fields = Ingenico::Direct::SDK::Domain::FraudFields.new_from_hash(hash['fraudFields'])
  end
  if hash.key? 'hostedCheckoutSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificInput']] unless hash['hostedCheckoutSpecificInput'].is_a? Hash
    @hosted_checkout_specific_input = Ingenico::Direct::SDK::Domain::HostedCheckoutSpecificInput.new_from_hash(hash['hostedCheckoutSpecificInput'])
  end
  if hash.key? 'mobilePaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificInput']] unless hash['mobilePaymentMethodSpecificInput'].is_a? Hash
    @mobile_payment_method_specific_input = Ingenico::Direct::SDK::Domain::MobilePaymentMethodHostedCheckoutSpecificInput.new_from_hash(hash['mobilePaymentMethodSpecificInput'])
  end
  if hash.key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = Ingenico::Direct::SDK::Domain::Order.new_from_hash(hash['order'])
  end
  if hash.key? 'redirectPaymentMethodSpecificInput'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificInput']] unless hash['redirectPaymentMethodSpecificInput'].is_a? Hash
    @redirect_payment_method_specific_input = Ingenico::Direct::SDK::Domain::RedirectPaymentMethodSpecificInput.new_from_hash(hash['redirectPaymentMethodSpecificInput'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/create_hosted_checkout_request.rb, line 31
def to_h
  hash = super
  hash['cardPaymentMethodSpecificInput'] = @card_payment_method_specific_input.to_h if @card_payment_method_specific_input
  hash['fraudFields'] = @fraud_fields.to_h if @fraud_fields
  hash['hostedCheckoutSpecificInput'] = @hosted_checkout_specific_input.to_h if @hosted_checkout_specific_input
  hash['mobilePaymentMethodSpecificInput'] = @mobile_payment_method_specific_input.to_h if @mobile_payment_method_specific_input
  hash['order'] = @order.to_h if @order
  hash['redirectPaymentMethodSpecificInput'] = @redirect_payment_method_specific_input.to_h if @redirect_payment_method_specific_input
  hash
end