Class: Worldline::Connect::SDK::V1::Domain::CybersourceDecisionManager

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#clause_nameString

Returns the current value of clause_name.

Returns:

  • (String)

    the current value of clause_name



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/cybersource_decision_manager.rb', line 16

def clause_name
  @clause_name
end

#fraud_scoreInteger

Returns the current value of fraud_score.

Returns:

  • (Integer)

    the current value of fraud_score



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/cybersource_decision_manager.rb', line 16

def fraud_score
  @fraud_score
end

#policy_appliedString

Returns the current value of policy_applied.

Returns:

  • (String)

    the current value of policy_applied



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/cybersource_decision_manager.rb', line 16

def policy_applied
  @policy_applied
end

#reason_codesArray<String>

Returns the current value of reason_codes.

Returns:

  • (Array<String>)

    the current value of reason_codes



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/cybersource_decision_manager.rb', line 16

def reason_codes
  @reason_codes
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.has_key? 'clauseName'
    @clause_name = hash['clauseName']
  end
  if hash.has_key? 'fraudScore'
    @fraud_score = hash['fraudScore']
  end
  if hash.has_key? 'policyApplied'
    @policy_applied = hash['policyApplied']
  end
  if hash.has_key? 'reasonCodes'
    raise TypeError, "value '%s' is not an Array" % [hash['reasonCodes']] unless hash['reasonCodes'].is_a? Array
    @reason_codes = []
    hash['reasonCodes'].each do |e|
      @reason_codes << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


27
28
29
30
31
32
33
34
# File 'lib/worldline/connect/sdk/v1/domain/cybersource_decision_manager.rb', line 27

def to_h
  hash = super
  hash['clauseName'] = @clause_name unless @clause_name.nil?
  hash['fraudScore'] = @fraud_score unless @fraud_score.nil?
  hash['policyApplied'] = @policy_applied unless @policy_applied.nil?
  hash['reasonCodes'] = @reason_codes unless @reason_codes.nil?
  hash
end