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|null
17: */
18: public ?string $avsResult = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $cvvResult = null;
24:
25: /**
26: * @var FraugsterResults|null
27: */
28: public ?FraugsterResults $fraugster = null;
29:
30: /**
31: * @var FraudResultsRetailDecisions|null
32: */
33: public ?FraudResultsRetailDecisions $retailDecisions = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject(): object
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: *
59: * @return $this
60: * @throws UnexpectedValueException
61: */
62: public function fromObject(object $object): CardFraudResults
63: {
64: parent::fromObject($object);
65: if (property_exists($object, 'avsResult')) {
66: $this->avsResult = $object->avsResult;
67: }
68: if (property_exists($object, 'cvvResult')) {
69: $this->cvvResult = $object->cvvResult;
70: }
71: if (property_exists($object, 'fraugster')) {
72: if (!is_object($object->fraugster)) {
73: throw new UnexpectedValueException('value \'' . print_r($object->fraugster, true) . '\' is not an object');
74: }
75: $value = new FraugsterResults();
76: $this->fraugster = $value->fromObject($object->fraugster);
77: }
78: if (property_exists($object, 'retailDecisions')) {
79: if (!is_object($object->retailDecisions)) {
80: throw new UnexpectedValueException('value \'' . print_r($object->retailDecisions, true) . '\' is not an object');
81: }
82: $value = new FraudResultsRetailDecisions();
83: $this->retailDecisions = $value->fromObject($object->retailDecisions);
84: }
85: return $this;
86: }
87: }
88: