1: <?php
2:
3: namespace MaxMind\MinFraud\Model;
4:
5: /**
6: * Model of the Insights score response.
7: *
8: * @property-read \MaxMind\MinFraud\Model\BillingAddress $billingAddress An object
9: * containing minFraud data related to the billing address used in the
10: * transaction.
11: * @property-read \MaxMind\MinFraud\Model\CreditCard $creditCard An object containing
12: * minFraud data about the credit card used in the transaction.
13: * @property-read \MaxMind\MinFraud\Model\Device $device This object contains
14: * information about the device that MaxMind believes is associated with the
15: * IP address passed in the request.
16: * @property-read \MaxMind\MinFraud\Model\Email $email This object contains
17: * information about the email address passed in the request.
18: * @property-read \MaxMind\MinFraud\Model\IpAddress $ipAddress An object containing
19: * GeoIP2 and minFraud Insights information about the geolocated IP address.
20: * @property-read \MaxMind\MinFraud\Model\ShippingAddress $shippingAddress An object
21: * containing minFraud data related to the shipping address used in the
22: * transaction.
23: */
24: class Insights extends Score
25: {
26: /**
27: * @internal
28: */
29: protected $billingAddress;
30:
31: /**
32: * @internal
33: */
34: protected $creditCard;
35:
36: /**
37: * @internal
38: */
39: protected $device;
40:
41: /**
42: * @internal
43: */
44: protected $email;
45:
46: /**
47: * @internal
48: */
49: protected $ipAddress;
50:
51: /**
52: * @internal
53: */
54: protected $shippingAddress;
55:
56: public function __construct($response, $locales = ['en'])
57: {
58: parent::__construct($response, $locales);
59:
60: $this->billingAddress
61: = new BillingAddress($this->safeArrayLookup($response['billing_address']));
62: $this->creditCard
63: = new CreditCard($this->safeArrayLookup($response['credit_card']));
64: $this->device
65: = new Device($this->safeArrayLookup($response['device']));
66: $this->email
67: = new Email($this->safeArrayLookup($response['email']));
68: $this->ipAddress
69: = new IpAddress($this->safeArrayLookup($response['ip_address']), $locales);
70: $this->shippingAddress
71: = new ShippingAddress($this->safeArrayLookup($response['shipping_address']));
72: }
73: }
74: