1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class CardFraudResults extends FraudResults
14: {
15: /**
16: * @var string
17: */
18: public $avsResult = null;
19:
20: /**
21: * @var string
22: */
23: public $cvvResult = null;
24:
25: /**
26: * @var FraugsterResults
27: */
28: public $fraugster = null;
29:
30: /**
31: * @var FraudResultsRetailDecisions
32: */
33: public $retailDecisions = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject()
39: {
40: $object = parent::toObject();
41: if (!is_null($this->avsResult)) {
42: $object->avsResult = $this->avsResult;
43: }
44: if (!is_null($this->cvvResult)) {
45: $object->cvvResult = $this->cvvResult;
46: }
47: if (!is_null($this->fraugster)) {
48: $object->fraugster = $this->fraugster->toObject();
49: }
50: if (!is_null($this->retailDecisions)) {
51: $object->retailDecisions = $this->retailDecisions->toObject();
52: }
53: return $object;
54: }
55:
56: /**
57: * @param object $object
58: * @return $this
59: * @throws UnexpectedValueException
60: */
61: public function fromObject($object)
62: {
63: parent::fromObject($object);
64: if (property_exists($object, 'avsResult')) {
65: $this->avsResult = $object->avsResult;
66: }
67: if (property_exists($object, 'cvvResult')) {
68: $this->cvvResult = $object->cvvResult;
69: }
70: if (property_exists($object, 'fraugster')) {
71: if (!is_object($object->fraugster)) {
72: throw new UnexpectedValueException('value \'' . print_r($object->fraugster, true) . '\' is not an object');
73: }
74: $value = new FraugsterResults();
75: $this->fraugster = $value->fromObject($object->fraugster);
76: }
77: if (property_exists($object, 'retailDecisions')) {
78: if (!is_object($object->retailDecisions)) {
79: throw new UnexpectedValueException('value \'' . print_r($object->retailDecisions, true) . '\' is not an object');
80: }
81: $value = new FraudResultsRetailDecisions();
82: $this->retailDecisions = $value->fromObject($object->retailDecisions);
83: }
84: return $this;
85: }
86: }
87: