Class: CyberSource::UnifiedriskRiskAssessment

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb

Overview

Risk scoring configuration, buyer history, transaction counts, and third-party risk indicators

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UnifiedriskRiskAssessment

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 105

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'thirdPartyIndicators')
    self.third_party_indicators = attributes[:'thirdPartyIndicators']
  end

  if attributes.has_key?(:'thirdPartyScore')
    self.third_party_score = attributes[:'thirdPartyScore']
  end

  if attributes.has_key?(:'thirdPartyScores')
    self.third_party_scores = attributes[:'thirdPartyScores']
  end

  if attributes.has_key?(:'buyerHistory')
    self.buyer_history = attributes[:'buyerHistory']
  end

  if attributes.has_key?(:'auxiliaryData')
    self.auxiliary_data = attributes[:'auxiliaryData']
  end

  if attributes.has_key?(:'vital4')
    self.vital4 = attributes[:'vital4']
  end

  if attributes.has_key?(:'isConfirmedRisk')
    self.is_confirmed_risk = attributes[:'isConfirmedRisk']
  end

  if attributes.has_key?(:'reportedBy')
    self.reported_by = attributes[:'reportedBy']
  end

  if attributes.has_key?(:'merchantScore')
    self.merchant_score = attributes[:'merchantScore']
  end

  if attributes.has_key?(:'merchantFraudRate')
    self.merchant_fraud_rate = attributes[:'merchantFraudRate']
  end

  if attributes.has_key?(:'trustlistStatus')
    self.trustlist_status = attributes[:'trustlistStatus']
  end

  if attributes.has_key?(:'trustlistSource')
    self.trustlist_source = attributes[:'trustlistSource']
  end
end

Instance Attribute Details

#auxiliary_dataObject

Returns the value of attribute auxiliary_data.



27
28
29
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 27

def auxiliary_data
  @auxiliary_data
end

#buyer_historyObject

Returns the value of attribute buyer_history.



25
26
27
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 25

def buyer_history
  @buyer_history
end

#is_confirmed_riskObject

Indicates whether this transaction has been confirmed as fraudulent or high-risk through post-transaction investigation. True flags the transaction for model feedback and alert closure



32
33
34
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 32

def is_confirmed_risk
  @is_confirmed_risk
end

#merchant_fraud_rateObject

The merchant's fraud rate expressed as a percentage or basis points, representing the ratio of confirmed fraudulent transactions to total transactions over a rolling period



41
42
43
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 41

def merchant_fraud_rate
  @merchant_fraud_rate
end

#merchant_scoreObject

Risk score specific to the merchant's fraud exposure level, derived from the merchant's historical fraud rates, chargeback ratio, and industry risk profile



38
39
40
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 38

def merchant_score
  @merchant_score
end

#reported_byObject

Identifier or name of the entity (customer, merchant, or internal team) that reported this transaction as fraudulent or suspicious



35
36
37
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 35

def reported_by
  @reported_by
end

#third_party_indicatorsObject

Any risk indicators provided by a third party provider that is integrated with ARIC. This is a free text field, and if there are multiple risk indicators, they should each be separated by a comma.



18
19
20
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 18

def third_party_indicators
  @third_party_indicators
end

#third_party_scoreObject

Risk Score provided by a third party that is integrated with ARIC.



21
22
23
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 21

def third_party_score
  @third_party_score
end

#third_party_scoresObject

Returns the value of attribute third_party_scores.



23
24
25
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 23

def third_party_scores
  @third_party_scores
end

#trustlist_sourceObject

The source system or registry that determined the trustlist status (e.g., MERCHANT_WHITELIST, NETWORK_WHITELIST, INTERNAL_TRUSTLIST)



47
48
49
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 47

def trustlist_source
  @trustlist_source
end

#trustlist_statusObject

Indicates whether the payer or payee appears on a trust list, reducing friction for known-good entities. Values - TRUSTED, UNTRUSTED, UNKNOWN



44
45
46
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 44

def trustlist_status
  @trustlist_status
end

#vital4Object

Returns the value of attribute vital4.



29
30
31
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 29

def vital4
  @vital4
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 50

def self.attribute_map
  {
    :'third_party_indicators' => :'thirdPartyIndicators',
    :'third_party_score' => :'thirdPartyScore',
    :'third_party_scores' => :'thirdPartyScores',
    :'buyer_history' => :'buyerHistory',
    :'auxiliary_data' => :'auxiliaryData',
    :'vital4' => :'vital4',
    :'is_confirmed_risk' => :'isConfirmedRisk',
    :'reported_by' => :'reportedBy',
    :'merchant_score' => :'merchantScore',
    :'merchant_fraud_rate' => :'merchantFraudRate',
    :'trustlist_status' => :'trustlistStatus',
    :'trustlist_source' => :'trustlistSource'
  }
end

.json_mapObject

Attribute mapping from JSON key to ruby-style variable name.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 68

def self.json_map
  {
    :'third_party_indicators' => :'third_party_indicators',
    :'third_party_score' => :'third_party_score',
    :'third_party_scores' => :'third_party_scores',
    :'buyer_history' => :'buyer_history',
    :'auxiliary_data' => :'auxiliary_data',
    :'vital4' => :'vital4',
    :'is_confirmed_risk' => :'is_confirmed_risk',
    :'reported_by' => :'reported_by',
    :'merchant_score' => :'merchant_score',
    :'merchant_fraud_rate' => :'merchant_fraud_rate',
    :'trustlist_status' => :'trustlist_status',
    :'trustlist_source' => :'trustlist_source'
  }
end

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 86

def self.swagger_types
  {
    :'third_party_indicators' => :'String',
    :'third_party_score' => :'Float',
    :'third_party_scores' => :'Object',
    :'buyer_history' => :'UnifiedriskRiskAssessmentBuyerHistory',
    :'auxiliary_data' => :'Object',
    :'vital4' => :'UnifiedriskRiskAssessmentVital4',
    :'is_confirmed_risk' => :'BOOLEAN',
    :'reported_by' => :'String',
    :'merchant_score' => :'String',
    :'merchant_fraud_rate' => :'String',
    :'trustlist_status' => :'String',
    :'trustlist_source' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 175

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      third_party_indicators == o.third_party_indicators &&
      third_party_score == o.third_party_score &&
      third_party_scores == o.third_party_scores &&
      buyer_history == o.buyer_history &&
      auxiliary_data == o.auxiliary_data &&
      vital4 == o.vital4 &&
      is_confirmed_risk == o.is_confirmed_risk &&
      reported_by == o.reported_by &&
      merchant_score == o.merchant_score &&
      merchant_fraud_rate == o.merchant_fraud_rate &&
      trustlist_status == o.trustlist_status &&
      trustlist_source == o.trustlist_source
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 228

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 294

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 207

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


194
195
196
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 194

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



200
201
202
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 200

def hash
  [third_party_indicators, third_party_score, third_party_scores, buyer_history, auxiliary_data, vital4, is_confirmed_risk, reported_by, merchant_score, merchant_fraud_rate, trustlist_status, trustlist_source].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



162
163
164
165
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 162

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



274
275
276
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 274

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



280
281
282
283
284
285
286
287
288
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 280

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



268
269
270
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 268

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



169
170
171
# File 'lib/cybersource_rest_client/models/unifiedrisk_risk_assessment.rb', line 169

def valid?
  true
end