Class: Ingenico::Connect::SDK::Domain::Riskassessments::RiskAssessment
Instance Attribute Summary collapse
Instance Method Summary
collapse
new_from_hash
Instance Attribute Details
18
19
20
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 18
def fraud_fields
@fraud_fields
end
|
18
19
20
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 18
def merchant
@merchant
end
|
18
19
20
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 18
def order
@order
end
|
#payment_product_id ⇒ Integer
18
19
20
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 18
def payment_product_id
@payment_product_id
end
|
Instance Method Details
#from_hash(hash) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 38
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 = Ingenico::Connect::SDK::Domain::Definitions::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 = Ingenico::Connect::SDK::Domain::Riskassessments::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 = Ingenico::Connect::SDK::Domain::Riskassessments::OrderRiskAssessment.new_from_hash(hash['order'])
end
if hash.has_key? 'paymentProductId'
@payment_product_id = hash['paymentProductId']
end
end
|
#to_h ⇒ Hash
29
30
31
32
33
34
35
36
|
# File 'lib/ingenico/connect/sdk/domain/riskassessments/risk_assessment.rb', line 29
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
|