class Ingenico::Connect::SDK::Domain::Riskassessments::CustomerRiskAssessment

@attr [Ingenico::Connect::SDK::Domain::Riskassessments::CustomerAccountRiskAssessment] account @attr [String] account_type @attr [Ingenico::Connect::SDK::Domain::Definitions::Address] billing_address @attr [Ingenico::Connect::SDK::Domain::Riskassessments::ContactDetailsRiskAssessment] contact_details @attr [Ingenico::Connect::SDK::Domain::Riskassessments::CustomerDeviceRiskAssessment] device @attr [true/false] is_previous_customer @attr [String] locale @attr [Ingenico::Connect::SDK::Domain::Riskassessments::PersonalInformationRiskAssessment] personal_information @attr [Ingenico::Connect::SDK::Domain::Payment::AddressPersonal] shipping_address

Attributes

account[RW]
account_type[RW]
billing_address[RW]
contact_details[RW]
device[RW]
is_previous_customer[RW]
locale[RW]
personal_information[RW]
shipping_address[RW]

@deprecated Use Order.shipping.address instead

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb, line 63
def from_hash(hash)
  super
  if hash.has_key? 'account'
    raise TypeError, "value '%s' is not a Hash" % [hash['account']] unless hash['account'].is_a? Hash
    @account = Ingenico::Connect::SDK::Domain::Riskassessments::CustomerAccountRiskAssessment.new_from_hash(hash['account'])
  end
  if hash.has_key? 'accountType'
    @account_type = hash['accountType']
  end
  if hash.has_key? 'billingAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']] unless hash['billingAddress'].is_a? Hash
    @billing_address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['billingAddress'])
  end
  if hash.has_key? 'contactDetails'
    raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash
    @contact_details = Ingenico::Connect::SDK::Domain::Riskassessments::ContactDetailsRiskAssessment.new_from_hash(hash['contactDetails'])
  end
  if hash.has_key? 'device'
    raise TypeError, "value '%s' is not a Hash" % [hash['device']] unless hash['device'].is_a? Hash
    @device = Ingenico::Connect::SDK::Domain::Riskassessments::CustomerDeviceRiskAssessment.new_from_hash(hash['device'])
  end
  if hash.has_key? 'isPreviousCustomer'
    @is_previous_customer = hash['isPreviousCustomer']
  end
  if hash.has_key? 'locale'
    @locale = hash['locale']
  end
  if hash.has_key? 'personalInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash
    @personal_information = Ingenico::Connect::SDK::Domain::Riskassessments::PersonalInformationRiskAssessment.new_from_hash(hash['personalInformation'])
  end
  if hash.has_key? 'shippingAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['shippingAddress']] unless hash['shippingAddress'].is_a? Hash
    @shipping_address = Ingenico::Connect::SDK::Domain::Payment::AddressPersonal.new_from_hash(hash['shippingAddress'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/riskassessments/customer_risk_assessment.rb, line 49
def to_h
  hash = super
  hash['account'] = @account.to_h unless @account.nil?
  hash['accountType'] = @account_type unless @account_type.nil?
  hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil?
  hash['contactDetails'] = @contact_details.to_h unless @contact_details.nil?
  hash['device'] = @device.to_h unless @device.nil?
  hash['isPreviousCustomer'] = @is_previous_customer unless @is_previous_customer.nil?
  hash['locale'] = @locale unless @locale.nil?
  hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil?
  hash['shippingAddress'] = @shipping_address.to_h unless @shipping_address.nil?
  hash
end