Class: Braintree::RiskData

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/risk_data.rb,
lib/braintree/risk_data/liability_shift.rb

Defined Under Namespace

Classes: LiabilityShift

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class

Constructor Details

#initialize(attributes) ⇒ RiskData

Returns a new instance of RiskData.



16
17
18
19
# File 'lib/braintree/risk_data.rb', line 16

def initialize(attributes)
  set_instance_variables_from_hash attributes unless attributes.nil?
  @liability_shift = LiabilityShift.new(attributes[:liability_shift]) if attributes[:liability_shift]
end

Instance Attribute Details

#customer_device_idObject (readonly)

Returns the value of attribute customer_device_id.



5
6
7
# File 'lib/braintree/risk_data.rb', line 5

def customer_device_id
  @customer_device_id
end

#customer_location_zipObject (readonly)

Returns the value of attribute customer_location_zip.



6
7
8
# File 'lib/braintree/risk_data.rb', line 6

def customer_location_zip
  @customer_location_zip
end

#customer_tenureObject (readonly)

Returns the value of attribute customer_tenure.



7
8
9
# File 'lib/braintree/risk_data.rb', line 7

def customer_tenure
  @customer_tenure
end

#decisionObject (readonly)

Returns the value of attribute decision.



8
9
10
# File 'lib/braintree/risk_data.rb', line 8

def decision
  @decision
end

#decision_reasonsObject (readonly)

Returns the value of attribute decision_reasons.



9
10
11
# File 'lib/braintree/risk_data.rb', line 9

def decision_reasons
  @decision_reasons
end

#device_data_capturedObject (readonly)

Returns the value of attribute device_data_captured.



10
11
12
# File 'lib/braintree/risk_data.rb', line 10

def device_data_captured
  @device_data_captured
end

#fraud_service_providerObject (readonly)

Returns the value of attribute fraud_service_provider.



11
12
13
# File 'lib/braintree/risk_data.rb', line 11

def fraud_service_provider
  @fraud_service_provider
end

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/braintree/risk_data.rb', line 12

def id
  @id
end

#liability_shiftObject (readonly)

Returns the value of attribute liability_shift.



13
14
15
# File 'lib/braintree/risk_data.rb', line 13

def liability_shift
  @liability_shift
end

#transaction_risk_scoreObject (readonly)

Returns the value of attribute transaction_risk_score.



14
15
16
# File 'lib/braintree/risk_data.rb', line 14

def transaction_risk_score
  @transaction_risk_score
end

Instance Method Details

#inspectObject



21
22
23
24
25
26
27
# File 'lib/braintree/risk_data.rb', line 21

def inspect
  attr_order = [:id, :decision, :decision_reasons, :device_data_captured, :fraud_service_provider, :liability_shift, :transaction_risk_score]
  formatted_attrs = attr_order.map do |attr|
    "#{attr}: #{send(attr).inspect}"
  end
  "#<RiskData #{formatted_attrs.join(", ")}>"
end