Class: VisaAcceptanceMergedSpec::DeviceInformation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/device_information.rb

Overview

DeviceInformation Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id: SKIP, host_name: SKIP, ip_address: SKIP, user_agent: SKIP, fingerprint_session_id: SKIP, use_raw_fingerprint_session_id: SKIP, device_type: SKIP, app_url: SKIP, metadata: SKIP, raw_data: SKIP, http_accept_browser_value: SKIP, http_accept_content: SKIP, http_browser_email: SKIP, http_browser_language: SKIP, http_browser_java_enabled: SKIP, http_browser_java_script_enabled: SKIP, http_browser_color_depth: SKIP, http_browser_screen_height: SKIP, http_browser_screen_width: SKIP, http_browser_time_difference: SKIP, user_agent_browser_value: SKIP, additional_properties: nil) ⇒ DeviceInformation

Returns a new instance of DeviceInformation.



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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 229

def initialize(id: SKIP, host_name: SKIP, ip_address: SKIP,
               user_agent: SKIP, fingerprint_session_id: SKIP,
               use_raw_fingerprint_session_id: SKIP, device_type: SKIP,
               app_url: SKIP, metadata: SKIP, raw_data: SKIP,
               http_accept_browser_value: SKIP, http_accept_content: SKIP,
               http_browser_email: SKIP, http_browser_language: SKIP,
               http_browser_java_enabled: SKIP,
               http_browser_java_script_enabled: SKIP,
               http_browser_color_depth: SKIP,
               http_browser_screen_height: SKIP,
               http_browser_screen_width: SKIP,
               http_browser_time_difference: SKIP,
               user_agent_browser_value: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @host_name = host_name unless host_name == SKIP
  @ip_address = ip_address unless ip_address == SKIP
  @user_agent = user_agent unless user_agent == SKIP
  @fingerprint_session_id = fingerprint_session_id unless fingerprint_session_id == SKIP
  unless use_raw_fingerprint_session_id == SKIP
    @use_raw_fingerprint_session_id =
      use_raw_fingerprint_session_id
  end
  @device_type = device_type unless device_type == SKIP
  @app_url = app_url unless app_url == SKIP
  @metadata =  unless  == SKIP
  @raw_data = raw_data unless raw_data == SKIP
  unless http_accept_browser_value == SKIP
    @http_accept_browser_value =
      http_accept_browser_value
  end
  @http_accept_content = http_accept_content unless http_accept_content == SKIP
  @http_browser_email = http_browser_email unless http_browser_email == SKIP
  @http_browser_language = http_browser_language unless http_browser_language == SKIP
  unless http_browser_java_enabled == SKIP
    @http_browser_java_enabled =
      http_browser_java_enabled
  end
  unless http_browser_java_script_enabled == SKIP
    @http_browser_java_script_enabled =
      http_browser_java_script_enabled
  end
  @http_browser_color_depth = http_browser_color_depth unless http_browser_color_depth == SKIP
  unless http_browser_screen_height == SKIP
    @http_browser_screen_height =
      http_browser_screen_height
  end
  unless http_browser_screen_width == SKIP
    @http_browser_screen_width =
      http_browser_screen_width
  end
  unless http_browser_time_difference == SKIP
    @http_browser_time_difference =
      http_browser_time_difference
  end
  @user_agent_browser_value = user_agent_browser_value unless user_agent_browser_value == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#app_urlString

This field will contain the deep link that would help the Customer App to wake up.

Returns:

  • (String)


86
87
88
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 86

def app_url
  @app_url
end

#device_typeString

The device type at the client side.

Returns:

  • (String)


81
82
83
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 81

def device_type
  @device_type
end

#fingerprint_session_idString

Field that contains the session ID that you send to Decision Manager to obtain the device fingerprint information. The string can contain uppercase and lowercase letters, digits, hyphen (-), and underscore (_). However, do not use the same uppercase and lowercase letters to indicate different session IDs. The session ID must be unique for each merchant ID. You can use any string that you are already generating, such as an order number or web session ID. The session ID must be unique for each page load, regardless of an individual’s web session ID. If a user navigates to a profiled page and is assigned a web session, navigates away from the profiled page, then navigates back to the profiled page, the generated session ID should be different and unique. You may use a web session ID, but it is preferable to use an application GUID (Globally Unique Identifier). This measure ensures that a unique ID is generated every time the page is loaded, even if it is the same user reloading the page.

Returns:

  • (String)


68
69
70
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 68

def fingerprint_session_id
  @fingerprint_session_id
end

#host_nameString

DNS resolved hostname from ipAddress.

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 31

def host_name
  @host_name
end

#http_accept_browser_valueString

Value of the Accept header sent by the customer’s web browser. Note If the customer’s browser provides a value, you must include it in your request.

Returns:

  • (String)


114
115
116
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 114

def http_accept_browser_value
  @http_accept_browser_value
end

#http_accept_contentString

The exact content of the HTTP accept header.

Returns:

  • (String)


118
119
120
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 118

def http_accept_content
  @http_accept_content
end

#http_browser_color_depthString

Value represents the bit depth of the color palette for displaying images, in bits per pixel. Example : 24, refer for more details

Returns:

  • (String)


148
149
150
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 148

def http_browser_color_depth
  @http_browser_color_depth
end

#http_browser_emailString

Email address set in the customer’s browser, which may differ from customer email.

Returns:

  • (String)


123
124
125
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 123

def http_browser_email
  @http_browser_email
end

#http_browser_java_enabledTrueClass | FalseClass

A Boolean value that represents the ability of the cardholder browser to execute Java. Value is returned from the navigator.javaEnabled property. Possible Values:True/False

Returns:

  • (TrueClass | FalseClass)


135
136
137
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 135

def http_browser_java_enabled
  @http_browser_java_enabled
end

#http_browser_java_script_enabledTrueClass | FalseClass

A Boolean value that represents the ability of the cardholder browser to execute JavaScript. Possible Values:True/False. Note: Merchants should be able to know the values from fingerprint details of cardholder's browser.

Returns:

  • (TrueClass | FalseClass)


142
143
144
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 142

def http_browser_java_script_enabled
  @http_browser_java_script_enabled
end

#http_browser_languageString

Value represents the browser language as defined in IETF BCP47. Example:en-US, refer for more details.

Returns:

  • (String)


128
129
130
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 128

def http_browser_language
  @http_browser_language
end

#http_browser_screen_heightString

Total height of the Cardholder's scree in pixels, example: 864.

Returns:

  • (String)


152
153
154
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 152

def http_browser_screen_height
  @http_browser_screen_height
end

#http_browser_screen_widthString

Total width of the cardholder's screen in pixels. Example: 1536.

Returns:

  • (String)


156
157
158
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 156

def http_browser_screen_width
  @http_browser_screen_width
end

#http_browser_time_differenceString

Time difference between UTC time and the cardholder browser local time, in minutes, Example:300

Returns:

  • (String)


161
162
163
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 161

def http_browser_time_difference
  @http_browser_time_difference
end

#idString

Value created by the client software that uniquely identifies the POS device. Visa Acceptance does not forward this value to the processor. Instead, the value is forwarded to the Visa Acceptance reporting functionality. This field is supported only for authorizations and credits on these processors:

  • American Express Direct
  • Credit Mutuel-CIC
  • FDC Nashville Global
  • OmniPay Direct
  • SIX Optional field. String (32)

Returns:

  • (String)


27
28
29
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 27

def id
  @id
end

#ip_addressString

IP address of the customer.

Used by

Authorization, Capture, and Credit Optional field.

Returns:

  • (String)


38
39
40
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 38

def ip_address
  @ip_address
end

#metadataString

Verifies that the payment is originating from a valid, user-approved application and device. Sending this field helps reduce fraud and declined transactions. Note The length is set for a hexadecimal representation of the GUID/UUID. This field accepts a 36-character string (with hyphens) or a 32-character string (without hyphens). Example 123e4567-e89b-12d3-a456-426655440000 Example 123e4567e89b12d3a456426655440000

Returns:

  • (String)


97
98
99
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 97

def 
  @metadata
end

#raw_dataArray[RawDatum]

Verifies that the payment is originating from a valid, user-approved application and device. Sending this field helps reduce fraud and declined transactions. Note The length is set for a hexadecimal representation of the GUID/UUID. This field accepts a 36-character string (with hyphens) or a 32-character string (without hyphens). Example 123e4567-e89b-12d3-a456-426655440000 Example 123e4567e89b12d3a456426655440000

Returns:



108
109
110
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 108

def raw_data
  @raw_data
end

#use_raw_fingerprint_session_idTrueClass | FalseClass

Boolean that indicates whether request contains the device fingerprint information. Values:

  • true: Use raw fingerprintSessionId when looking up device details.
  • false (default): Use merchant id + fingerprintSessionId as the session id for Device detail collection.

Returns:

  • (TrueClass | FalseClass)


77
78
79
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 77

def use_raw_fingerprint_session_id
  @use_raw_fingerprint_session_id
end

#user_agentString

Customer’s browser as identified from the HTTP header data. For example, Mozilla is the value that identifies the Netscape browser.

Returns:

  • (String)


44
45
46
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 44

def user_agent
  @user_agent
end

#user_agent_browser_valueString

Value of the User-Agent header sent by the customer’s web browser. Note If the customer’s browser provides a value, you must include it in your request.

Returns:

  • (String)


167
168
169
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 167

def user_agent_browser_value
  @user_agent_browser_value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
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
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 291

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  host_name = hash.key?('hostName') ? hash['hostName'] : SKIP
  ip_address = hash.key?('ipAddress') ? hash['ipAddress'] : SKIP
  user_agent = hash.key?('userAgent') ? hash['userAgent'] : SKIP
  fingerprint_session_id =
    hash.key?('fingerprintSessionId') ? hash['fingerprintSessionId'] : SKIP
  use_raw_fingerprint_session_id =
    hash.key?('useRawFingerprintSessionId') ? hash['useRawFingerprintSessionId'] : SKIP
  device_type = hash.key?('deviceType') ? hash['deviceType'] : SKIP
  app_url = hash.key?('appUrl') ? hash['appUrl'] : SKIP
   = hash.key?('metadata') ? hash['metadata'] : SKIP
  # Parameter is an array, so we need to iterate through it
  raw_data = nil
  unless hash['rawData'].nil?
    raw_data = []
    hash['rawData'].each do |structure|
      raw_data << (RawDatum.from_hash(structure) if structure)
    end
  end

  raw_data = SKIP unless hash.key?('rawData')
  http_accept_browser_value =
    hash.key?('httpAcceptBrowserValue') ? hash['httpAcceptBrowserValue'] : SKIP
  http_accept_content =
    hash.key?('httpAcceptContent') ? hash['httpAcceptContent'] : SKIP
  http_browser_email =
    hash.key?('httpBrowserEmail') ? hash['httpBrowserEmail'] : SKIP
  http_browser_language =
    hash.key?('httpBrowserLanguage') ? hash['httpBrowserLanguage'] : SKIP
  http_browser_java_enabled =
    hash.key?('httpBrowserJavaEnabled') ? hash['httpBrowserJavaEnabled'] : SKIP
  http_browser_java_script_enabled =
    hash.key?('httpBrowserJavaScriptEnabled') ? hash['httpBrowserJavaScriptEnabled'] : SKIP
  http_browser_color_depth =
    hash.key?('httpBrowserColorDepth') ? hash['httpBrowserColorDepth'] : SKIP
  http_browser_screen_height =
    hash.key?('httpBrowserScreenHeight') ? hash['httpBrowserScreenHeight'] : SKIP
  http_browser_screen_width =
    hash.key?('httpBrowserScreenWidth') ? hash['httpBrowserScreenWidth'] : SKIP
  http_browser_time_difference =
    hash.key?('httpBrowserTimeDifference') ? hash['httpBrowserTimeDifference'] : SKIP
  user_agent_browser_value =
    hash.key?('userAgentBrowserValue') ? hash['userAgentBrowserValue'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  DeviceInformation.new(id: id,
                        host_name: host_name,
                        ip_address: ip_address,
                        user_agent: user_agent,
                        fingerprint_session_id: fingerprint_session_id,
                        use_raw_fingerprint_session_id: use_raw_fingerprint_session_id,
                        device_type: device_type,
                        app_url: app_url,
                        metadata: ,
                        raw_data: raw_data,
                        http_accept_browser_value: http_accept_browser_value,
                        http_accept_content: http_accept_content,
                        http_browser_email: http_browser_email,
                        http_browser_language: http_browser_language,
                        http_browser_java_enabled: http_browser_java_enabled,
                        http_browser_java_script_enabled: http_browser_java_script_enabled,
                        http_browser_color_depth: http_browser_color_depth,
                        http_browser_screen_height: http_browser_screen_height,
                        http_browser_screen_width: http_browser_screen_width,
                        http_browser_time_difference: http_browser_time_difference,
                        user_agent_browser_value: user_agent_browser_value,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 170

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['host_name'] = 'hostName'
  @_hash['ip_address'] = 'ipAddress'
  @_hash['user_agent'] = 'userAgent'
  @_hash['fingerprint_session_id'] = 'fingerprintSessionId'
  @_hash['use_raw_fingerprint_session_id'] = 'useRawFingerprintSessionId'
  @_hash['device_type'] = 'deviceType'
  @_hash['app_url'] = 'appUrl'
  @_hash['metadata'] = 'metadata'
  @_hash['raw_data'] = 'rawData'
  @_hash['http_accept_browser_value'] = 'httpAcceptBrowserValue'
  @_hash['http_accept_content'] = 'httpAcceptContent'
  @_hash['http_browser_email'] = 'httpBrowserEmail'
  @_hash['http_browser_language'] = 'httpBrowserLanguage'
  @_hash['http_browser_java_enabled'] = 'httpBrowserJavaEnabled'
  @_hash['http_browser_java_script_enabled'] =
    'httpBrowserJavaScriptEnabled'
  @_hash['http_browser_color_depth'] = 'httpBrowserColorDepth'
  @_hash['http_browser_screen_height'] = 'httpBrowserScreenHeight'
  @_hash['http_browser_screen_width'] = 'httpBrowserScreenWidth'
  @_hash['http_browser_time_difference'] = 'httpBrowserTimeDifference'
  @_hash['user_agent_browser_value'] = 'userAgentBrowserValue'
  @_hash
end

.nullablesObject

An array for nullable fields



225
226
227
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 225

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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/visa_acceptance_merged_spec/models/device_information.rb', line 198

def self.optionals
  %w[
    id
    host_name
    ip_address
    user_agent
    fingerprint_session_id
    use_raw_fingerprint_session_id
    device_type
    app_url
    metadata
    raw_data
    http_accept_browser_value
    http_accept_content
    http_browser_email
    http_browser_language
    http_browser_java_enabled
    http_browser_java_script_enabled
    http_browser_color_depth
    http_browser_screen_height
    http_browser_screen_width
    http_browser_time_difference
    user_agent_browser_value
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 390

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, host_name: #{@host_name.inspect}, ip_address:"\
  " #{@ip_address.inspect}, user_agent: #{@user_agent.inspect}, fingerprint_session_id:"\
  " #{@fingerprint_session_id.inspect}, use_raw_fingerprint_session_id:"\
  " #{@use_raw_fingerprint_session_id.inspect}, device_type: #{@device_type.inspect}, app_url:"\
  " #{@app_url.inspect}, metadata: #{@metadata.inspect}, raw_data: #{@raw_data.inspect},"\
  " http_accept_browser_value: #{@http_accept_browser_value.inspect}, http_accept_content:"\
  " #{@http_accept_content.inspect}, http_browser_email: #{@http_browser_email.inspect},"\
  " http_browser_language: #{@http_browser_language.inspect}, http_browser_java_enabled:"\
  " #{@http_browser_java_enabled.inspect}, http_browser_java_script_enabled:"\
  " #{@http_browser_java_script_enabled.inspect}, http_browser_color_depth:"\
  " #{@http_browser_color_depth.inspect}, http_browser_screen_height:"\
  " #{@http_browser_screen_height.inspect}, http_browser_screen_width:"\
  " #{@http_browser_screen_width.inspect}, http_browser_time_difference:"\
  " #{@http_browser_time_difference.inspect}, user_agent_browser_value:"\
  " #{@user_agent_browser_value.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/visa_acceptance_merged_spec/models/device_information.rb', line 372

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, host_name: #{@host_name}, ip_address: #{@ip_address},"\
  " user_agent: #{@user_agent}, fingerprint_session_id: #{@fingerprint_session_id},"\
  " use_raw_fingerprint_session_id: #{@use_raw_fingerprint_session_id}, device_type:"\
  " #{@device_type}, app_url: #{@app_url}, metadata: #{@metadata}, raw_data: #{@raw_data},"\
  " http_accept_browser_value: #{@http_accept_browser_value}, http_accept_content:"\
  " #{@http_accept_content}, http_browser_email: #{@http_browser_email},"\
  " http_browser_language: #{@http_browser_language}, http_browser_java_enabled:"\
  " #{@http_browser_java_enabled}, http_browser_java_script_enabled:"\
  " #{@http_browser_java_script_enabled}, http_browser_color_depth:"\
  " #{@http_browser_color_depth}, http_browser_screen_height: #{@http_browser_screen_height},"\
  " http_browser_screen_width: #{@http_browser_screen_width}, http_browser_time_difference:"\
  " #{@http_browser_time_difference}, user_agent_browser_value: #{@user_agent_browser_value},"\
  " additional_properties: #{@additional_properties}>"
end