Class: CyberSource::UnifiedriskAuthentication

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UnifiedriskAuthentication

Initializes the object

Parameters:

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

    Model attributes in the form of hash



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 143

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?(:'authenticationId')
    self.authentication_id = attributes[:'authenticationId']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.has_key?(:'languagePreference')
    if (value = attributes[:'languagePreference']).is_a?(Array)
      self.language_preference = value
    end
  end

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

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

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

Instance Attribute Details

#authentication_dateObject

The date and time when the cardholder completed authentication, used for tracking authentication timing and fraud analysis



55
56
57
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 55

def authentication_date
  @authentication_date
end

#authentication_idObject

Unique identifier assigned to an authentication attempt



17
18
19
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 17

def authentication_id
  @authentication_id
end

#authentication_indicatorObject

Indicates the type of authentication request being made, such as payment authentication, non-payment authentication, or recurring/installment transactions



52
53
54
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 52

def authentication_indicator
  @authentication_indicator
end

#challengeObject

Returns the value of attribute challenge.



40
41
42
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 40

def challenge
  @challenge
end

#decoupled_indicatorObject

Indicates whether decoupled authentication is requested or supported, allowing the cardholder to authenticate outside the main transaction flow. Values - "Y" (supported and preferred), "N" (do not use)



43
44
45
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 43

def decoupled_indicator
  @decoupled_indicator
end

#decoupled_max_timeObject

Maximum time in minutes allowed for the cardholder to complete a decoupled authentication, after which the session expires



46
47
48
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 46

def decoupled_max_time
  @decoupled_max_time
end

#emailObject

Email address used for authentication (e.g., verification code delivery)



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

def email
  @email
end

#language_preferenceObject

The cardholder's preferred language for the authentication challenge interface, expressed as an IETF BCP 47 language tag (e.g., en-US, fr-FR)



58
59
60
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 58

def language_preference
  @language_preference
end

#methodObject

Authentication method used during the authentication/MFA process



20
21
22
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 20

def method
  @method
end

#mfa_successfulObject

Whether multi-factor authentication was completed successfully



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

def mfa_successful
  @mfa_successful
end

#otherObject

Additional authentication-related information not captured by other fields



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

def other
  @other
end

#phone_numberObject

Phone number used for authentication (e.g., SMS/voice MFA)



26
27
28
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 26

def phone_number
  @phone_number
end

#spc_incomplete_indicatorObject

Indicates the reason why an SPC (Secure Payment Confirmation) transaction was not completed, helping distinguish cardholder-initiated abandonment from technical failures



64
65
66
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 64

def spc_incomplete_indicator
  @spc_incomplete_indicator
end

#spc_supportObject

Indicates whether the merchant's environment supports the Secure Payment Confirmation (SPC) protocol for frictionless authentication using FIDO2/WebAuthn credentials



61
62
63
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 61

def spc_support
  @spc_support
end

#three_ds_requestor_idObject

Unique identifier assigned to the 3D Secure requestor (typically the merchant or payment service provider) by the directory server for authentication routing



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

def three_ds_requestor_id
  @three_ds_requestor_id
end

#three_ds_requestor_nameObject

The business or brand name of the 3D Secure requestor as registered with the card network directory server



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

def three_ds_requestor_name
  @three_ds_requestor_name
end

#three_ri_indicatorObject

Indicates the reason for the 3DS Requestor Initiated (3RI) transaction - a merchant-initiated authentication without active cardholder participation. Values defined by EMVCo 3DS specification



49
50
51
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 49

def three_ri_indicator
  @three_ri_indicator
end

#versionObject

The 3D Secure protocol version used for this authentication attempt (e.g., "2.1.0", "2.2.0"), which determines which fields and features are supported



67
68
69
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 67

def version
  @version
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 70

def self.attribute_map
  {
    :'authentication_id' => :'authenticationId',
    :'method' => :'method',
    :'mfa_successful' => :'mfaSuccessful',
    :'phone_number' => :'phoneNumber',
    :'email' => :'email',
    :'other' => :'other',
    :'three_ds_requestor_id' => :'threeDSRequestorId',
    :'three_ds_requestor_name' => :'threeDSRequestorName',
    :'challenge' => :'challenge',
    :'decoupled_indicator' => :'decoupledIndicator',
    :'decoupled_max_time' => :'decoupledMaxTime',
    :'three_ri_indicator' => :'threeRIIndicator',
    :'authentication_indicator' => :'authenticationIndicator',
    :'authentication_date' => :'authenticationDate',
    :'language_preference' => :'languagePreference',
    :'spc_support' => :'spcSupport',
    :'spc_incomplete_indicator' => :'spcIncompleteIndicator',
    :'version' => :'version'
  }
end

.json_mapObject

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



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 94

def self.json_map
  {
    :'authentication_id' => :'authentication_id',
    :'method' => :'method',
    :'mfa_successful' => :'mfa_successful',
    :'phone_number' => :'phone_number',
    :'email' => :'email',
    :'other' => :'other',
    :'three_ds_requestor_id' => :'three_ds_requestor_id',
    :'three_ds_requestor_name' => :'three_ds_requestor_name',
    :'challenge' => :'challenge',
    :'decoupled_indicator' => :'decoupled_indicator',
    :'decoupled_max_time' => :'decoupled_max_time',
    :'three_ri_indicator' => :'three_ri_indicator',
    :'authentication_indicator' => :'authentication_indicator',
    :'authentication_date' => :'authentication_date',
    :'language_preference' => :'language_preference',
    :'spc_support' => :'spc_support',
    :'spc_incomplete_indicator' => :'spc_incomplete_indicator',
    :'version' => :'version'
  }
end

.swagger_typesObject

Attribute type mapping.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 118

def self.swagger_types
  {
    :'authentication_id' => :'String',
    :'method' => :'String',
    :'mfa_successful' => :'BOOLEAN',
    :'phone_number' => :'String',
    :'email' => :'String',
    :'other' => :'String',
    :'three_ds_requestor_id' => :'String',
    :'three_ds_requestor_name' => :'String',
    :'challenge' => :'UnifiedriskAuthenticationChallenge',
    :'decoupled_indicator' => :'String',
    :'decoupled_max_time' => :'String',
    :'three_ri_indicator' => :'String',
    :'authentication_indicator' => :'String',
    :'authentication_date' => :'String',
    :'language_preference' => :'Array<String>',
    :'spc_support' => :'String',
    :'spc_incomplete_indicator' => :'String',
    :'version' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 263

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      authentication_id == o.authentication_id &&
      method == o.method &&
      mfa_successful == o.mfa_successful &&
      phone_number == o.phone_number &&
      email == o.email &&
      other == o.other &&
      three_ds_requestor_id == o.three_ds_requestor_id &&
      three_ds_requestor_name == o.three_ds_requestor_name &&
      challenge == o.challenge &&
      decoupled_indicator == o.decoupled_indicator &&
      decoupled_max_time == o.decoupled_max_time &&
      three_ri_indicator == o.three_ri_indicator &&
      authentication_indicator == o.authentication_indicator &&
      authentication_date == o.authentication_date &&
      language_preference == o.language_preference &&
      spc_support == o.spc_support &&
      spc_incomplete_indicator == o.spc_incomplete_indicator &&
      version == o.version
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



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 322

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



388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 388

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



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 301

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


288
289
290
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 288

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



294
295
296
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 294

def hash
  [authentication_id, method, mfa_successful, phone_number, email, other, three_ds_requestor_id, three_ds_requestor_name, challenge, decoupled_indicator, decoupled_max_time, three_ri_indicator, authentication_indicator, authentication_date, language_preference, spc_support, spc_incomplete_indicator, version].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



226
227
228
229
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 226

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



368
369
370
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 368

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



374
375
376
377
378
379
380
381
382
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 374

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



362
363
364
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 362

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



233
234
235
# File 'lib/cybersource_rest_client/models/unifiedrisk_authentication.rb', line 233

def valid?
  true
end