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 FraudResults extends DataObject |
15: | { |
16: | |
17: | |
18: | |
19: | public $cybersourceDecisionManager = null; |
20: | |
21: | |
22: | |
23: | |
24: | public $fraudServiceResult = null; |
25: | |
26: | |
27: | |
28: | |
29: | public $inAuth = null; |
30: | |
31: | |
32: | |
33: | |
34: | public $microsoftFraudProtection = null; |
35: | |
36: | |
37: | |
38: | |
39: | public function toObject() |
40: | { |
41: | $object = parent::toObject(); |
42: | if (!is_null($this->cybersourceDecisionManager)) { |
43: | $object->cybersourceDecisionManager = $this->cybersourceDecisionManager->toObject(); |
44: | } |
45: | if (!is_null($this->fraudServiceResult)) { |
46: | $object->fraudServiceResult = $this->fraudServiceResult; |
47: | } |
48: | if (!is_null($this->inAuth)) { |
49: | $object->inAuth = $this->inAuth->toObject(); |
50: | } |
51: | if (!is_null($this->microsoftFraudProtection)) { |
52: | $object->microsoftFraudProtection = $this->microsoftFraudProtection->toObject(); |
53: | } |
54: | return $object; |
55: | } |
56: | |
57: | |
58: | |
59: | |
60: | |
61: | |
62: | public function fromObject($object) |
63: | { |
64: | parent::fromObject($object); |
65: | if (property_exists($object, 'cybersourceDecisionManager')) { |
66: | if (!is_object($object->cybersourceDecisionManager)) { |
67: | throw new UnexpectedValueException('value \'' . print_r($object->cybersourceDecisionManager, true) . '\' is not an object'); |
68: | } |
69: | $value = new CybersourceDecisionManager(); |
70: | $this->cybersourceDecisionManager = $value->fromObject($object->cybersourceDecisionManager); |
71: | } |
72: | if (property_exists($object, 'fraudServiceResult')) { |
73: | $this->fraudServiceResult = $object->fraudServiceResult; |
74: | } |
75: | if (property_exists($object, 'inAuth')) { |
76: | if (!is_object($object->inAuth)) { |
77: | throw new UnexpectedValueException('value \'' . print_r($object->inAuth, true) . '\' is not an object'); |
78: | } |
79: | $value = new InAuth(); |
80: | $this->inAuth = $value->fromObject($object->inAuth); |
81: | } |
82: | if (property_exists($object, 'microsoftFraudProtection')) { |
83: | if (!is_object($object->microsoftFraudProtection)) { |
84: | throw new UnexpectedValueException('value \'' . print_r($object->microsoftFraudProtection, true) . '\' is not an object'); |
85: | } |
86: | $value = new MicrosoftFraudResults(); |
87: | $this->microsoftFraudProtection = $value->fromObject($object->microsoftFraudProtection); |
88: | } |
89: | return $this; |
90: | } |
91: | } |
92: | |