Class: Worldline::Connect::SDK::V1::Domain::RiskAssessment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#fraud_fieldsWorldline::Connect::SDK::V1::Domain::FraudFields

Returns the current value of fraud_fields.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 19

def fraud_fields
  @fraud_fields
end

#merchantWorldline::Connect::SDK::V1::Domain::MerchantRiskAssessment

Returns the current value of merchant.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 19

def merchant
  @merchant
end

#orderWorldline::Connect::SDK::V1::Domain::OrderRiskAssessment

Returns the current value of order.

Returns:



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 19

def order
  @order
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



19
20
21
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 19

def payment_product_id
  @payment_product_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 39

def from_hash(hash)
  super
  if hash.has_key? 'fraudFields'
    raise TypeError, "value '%s' is not a Hash" % [hash['fraudFields']] unless hash['fraudFields'].is_a? Hash
    @fraud_fields = Worldline::Connect::SDK::V1::Domain::FraudFields.new_from_hash(hash['fraudFields'])
  end
  if hash.has_key? 'merchant'
    raise TypeError, "value '%s' is not a Hash" % [hash['merchant']] unless hash['merchant'].is_a? Hash
    @merchant = Worldline::Connect::SDK::V1::Domain::MerchantRiskAssessment.new_from_hash(hash['merchant'])
  end
  if hash.has_key? 'order'
    raise TypeError, "value '%s' is not a Hash" % [hash['order']] unless hash['order'].is_a? Hash
    @order = Worldline::Connect::SDK::V1::Domain::OrderRiskAssessment.new_from_hash(hash['order'])
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
end

#to_hHash

Returns:

  • (Hash)


30
31
32
33
34
35
36
37
# File 'lib/worldline/connect/sdk/v1/domain/risk_assessment.rb', line 30

def to_h
  hash = super
  hash['fraudFields'] = @fraud_fields.to_h unless @fraud_fields.nil?
  hash['merchant'] = @merchant.to_h unless @merchant.nil?
  hash['order'] = @order.to_h unless @order.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash
end