Class: Worldline::Connect::SDK::V1::Domain::CustomerRiskAssessment

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#accountWorldline::Connect::SDK::V1::Domain::CustomerAccountRiskAssessment

Returns the current value of account.

Returns:



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def 
  @account
end

#account_typeString

Returns the current value of account_type.

Returns:

  • (String)

    the current value of account_type



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def 
  @account_type
end

#billing_addressWorldline::Connect::SDK::V1::Domain::Address

Returns the current value of billing_address.

Returns:



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def billing_address
  @billing_address
end

#contact_detailsWorldline::Connect::SDK::V1::Domain::ContactDetailsRiskAssessment

Returns the current value of contact_details.

Returns:



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def contact_details
  @contact_details
end

#deviceWorldline::Connect::SDK::V1::Domain::CustomerDeviceRiskAssessment

Returns the current value of device.

Returns:



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def device
  @device
end

#is_previous_customertrue/false

Returns the current value of is_previous_customer.

Returns:

  • (true/false)

    the current value of is_previous_customer



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def is_previous_customer
  @is_previous_customer
end

#localeString

Returns the current value of locale.

Returns:

  • (String)

    the current value of locale



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def locale
  @locale
end

#personal_informationWorldline::Connect::SDK::V1::Domain::PersonalInformationRiskAssessment

Returns the current value of personal_information.

Returns:



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def personal_information
  @personal_information
end

#shipping_addressObject

Deprecated.

Use Order.shipping.address instead



27
28
29
# File 'lib/worldline/connect/sdk/v1/domain/customer_risk_assessment.rb', line 27

def shipping_address
  @shipping_address
end

Instance Method Details

#from_hash(hash) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
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
# File 'lib/worldline/connect/sdk/v1/domain/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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::AddressPersonal.new_from_hash(hash['shippingAddress'])
  end
end

#to_hHash

Returns:

  • (Hash)


49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/worldline/connect/sdk/v1/domain/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