1: <?php
2:
3: namespace MaxMind\MinFraud\Model;
4:
5: /**
6: * Model with information about the device.
7: *
8: * In order to receive device output from minFraud Insights or minFraud
9: * Factors, you must be using the Device Tracking Add-on.
10: *
11: * @link https://dev.maxmind.com/minfraud/device/ Device Tracking Add-on
12: *
13: * @property-read float|null $confidence This number represents our confidence that
14: * the `device_id` refers to a unique device as opposed to a cluster of
15: * similar devices. A confidence of 0.01 indicates very low confidence that
16: * the device is unique, whereas 99 indicates very high confidence.
17: * @property-read string|null $id A UUID that MaxMind uses for the device associated
18: * with this IP address. Note that many devices cannot be uniquely identified
19: * because they are too common (for example, all iPhones of a given model and
20: * OS release). In these cases, the minFraud service will simply not return a
21: * UUID for that device.
22: * @property-read string|null $lastSeen This is the date and time of the last
23: * sighting of the device. This is an RFC 3339 date-time.
24: * @property-read string|null $localTime This is the local date and time of
25: * the transaction in the time zone of the device. This is determined by using
26: * the UTC offset associated with the device. This is an RFC 3339 date-time
27: */
28: class Device extends AbstractModel
29: {
30: /**
31: * @internal
32: */
33: protected $confidence;
34:
35: /**
36: * @internal
37: */
38: protected $id;
39:
40: /**
41: * @internal
42: */
43: protected $lastSeen;
44:
45: /**
46: * @internal
47: */
48: protected $localTime;
49:
50: public function __construct($response, $locales = ['en'])
51: {
52: parent::__construct($response, $locales);
53: $this->confidence = $this->safeArrayLookup($response['confidence']);
54: $this->id = $this->safeArrayLookup($response['id']);
55: $this->lastSeen = $this->safeArrayLookup($response['last_seen']);
56: $this->localTime = $this->safeArrayLookup($response['local_time']);
57: }
58: }
59: