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: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class GPayThreeDSecure extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $challengeCanvasSize = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $challengeIndicator = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $exemptionRequest = null;
30:
31: /**
32: * @var RedirectionData|null
33: */
34: public ?RedirectionData $redirectionData = null;
35:
36: /**
37: * @var bool|null
38: */
39: public ?bool $skipAuthentication = null;
40:
41: /**
42: * @return object
43: */
44: public function toObject(): object
45: {
46: $object = parent::toObject();
47: if (!is_null($this->challengeCanvasSize)) {
48: $object->challengeCanvasSize = $this->challengeCanvasSize;
49: }
50: if (!is_null($this->challengeIndicator)) {
51: $object->challengeIndicator = $this->challengeIndicator;
52: }
53: if (!is_null($this->exemptionRequest)) {
54: $object->exemptionRequest = $this->exemptionRequest;
55: }
56: if (!is_null($this->redirectionData)) {
57: $object->redirectionData = $this->redirectionData->toObject();
58: }
59: if (!is_null($this->skipAuthentication)) {
60: $object->skipAuthentication = $this->skipAuthentication;
61: }
62: return $object;
63: }
64:
65: /**
66: * @param object $object
67: *
68: * @return $this
69: * @throws UnexpectedValueException
70: */
71: public function fromObject(object $object): GPayThreeDSecure
72: {
73: parent::fromObject($object);
74: if (property_exists($object, 'challengeCanvasSize')) {
75: $this->challengeCanvasSize = $object->challengeCanvasSize;
76: }
77: if (property_exists($object, 'challengeIndicator')) {
78: $this->challengeIndicator = $object->challengeIndicator;
79: }
80: if (property_exists($object, 'exemptionRequest')) {
81: $this->exemptionRequest = $object->exemptionRequest;
82: }
83: if (property_exists($object, 'redirectionData')) {
84: if (!is_object($object->redirectionData)) {
85: throw new UnexpectedValueException('value \'' . print_r($object->redirectionData, true) . '\' is not an object');
86: }
87: $value = new RedirectionData();
88: $this->redirectionData = $value->fromObject($object->redirectionData);
89: }
90: if (property_exists($object, 'skipAuthentication')) {
91: $this->skipAuthentication = $object->skipAuthentication;
92: }
93: return $this;
94: }
95: }
96: