1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | namespace Worldline\Connect\Sdk\V1\Domain; |
7: | |
8: | use UnexpectedValueException; |
9: | use Worldline\Connect\Sdk\Domain\DataObject; |
10: | |
11: | |
12: | |
13: | |
14: | class MicrosoftFraudResults extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $clauseName = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $deviceCountryCode = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $deviceId = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $fraudScore = null; |
35: | |
36: | |
37: | |
38: | |
39: | public $policyApplied = null; |
40: | |
41: | |
42: | |
43: | |
44: | public $reasonCodes = null; |
45: | |
46: | |
47: | |
48: | |
49: | public $trueIpAddress = null; |
50: | |
51: | |
52: | |
53: | |
54: | public $userDeviceType = null; |
55: | |
56: | |
57: | |
58: | |
59: | public function toObject() |
60: | { |
61: | $object = parent::toObject(); |
62: | if (!is_null($this->clauseName)) { |
63: | $object->clauseName = $this->clauseName; |
64: | } |
65: | if (!is_null($this->deviceCountryCode)) { |
66: | $object->deviceCountryCode = $this->deviceCountryCode; |
67: | } |
68: | if (!is_null($this->deviceId)) { |
69: | $object->deviceId = $this->deviceId; |
70: | } |
71: | if (!is_null($this->fraudScore)) { |
72: | $object->fraudScore = $this->fraudScore; |
73: | } |
74: | if (!is_null($this->policyApplied)) { |
75: | $object->policyApplied = $this->policyApplied; |
76: | } |
77: | if (!is_null($this->reasonCodes)) { |
78: | $object->reasonCodes = []; |
79: | foreach ($this->reasonCodes as $element) { |
80: | if (!is_null($element)) { |
81: | $object->reasonCodes[] = $element; |
82: | } |
83: | } |
84: | } |
85: | if (!is_null($this->trueIpAddress)) { |
86: | $object->trueIpAddress = $this->trueIpAddress; |
87: | } |
88: | if (!is_null($this->userDeviceType)) { |
89: | $object->userDeviceType = $this->userDeviceType; |
90: | } |
91: | return $object; |
92: | } |
93: | |
94: | |
95: | |
96: | |
97: | |
98: | |
99: | public function fromObject($object) |
100: | { |
101: | parent::fromObject($object); |
102: | if (property_exists($object, 'clauseName')) { |
103: | $this->clauseName = $object->clauseName; |
104: | } |
105: | if (property_exists($object, 'deviceCountryCode')) { |
106: | $this->deviceCountryCode = $object->deviceCountryCode; |
107: | } |
108: | if (property_exists($object, 'deviceId')) { |
109: | $this->deviceId = $object->deviceId; |
110: | } |
111: | if (property_exists($object, 'fraudScore')) { |
112: | $this->fraudScore = $object->fraudScore; |
113: | } |
114: | if (property_exists($object, 'policyApplied')) { |
115: | $this->policyApplied = $object->policyApplied; |
116: | } |
117: | if (property_exists($object, 'reasonCodes')) { |
118: | if (!is_array($object->reasonCodes) && !is_object($object->reasonCodes)) { |
119: | throw new UnexpectedValueException('value \'' . print_r($object->reasonCodes, true) . '\' is not an array or object'); |
120: | } |
121: | $this->reasonCodes = []; |
122: | foreach ($object->reasonCodes as $element) { |
123: | $this->reasonCodes[] = $element; |
124: | } |
125: | } |
126: | if (property_exists($object, 'trueIpAddress')) { |
127: | $this->trueIpAddress = $object->trueIpAddress; |
128: | } |
129: | if (property_exists($object, 'userDeviceType')) { |
130: | $this->userDeviceType = $object->userDeviceType; |
131: | } |
132: | return $this; |
133: | } |
134: | } |
135: | |