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 AbstractThreeDSecure extends DataObject
15: {
16: /**
17: * @var AmountOfMoney|null
18: */
19: public ?AmountOfMoney $authenticationAmount = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $authenticationFlow = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $challengeCanvasSize = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $challengeIndicator = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $exemptionRequest = null;
40:
41: /**
42: * @var ThreeDSecureData|null
43: */
44: public ?ThreeDSecureData $priorThreeDSecureData = null;
45:
46: /**
47: * @var SdkDataInput|null
48: */
49: public ?SdkDataInput $sdkData = null;
50:
51: /**
52: * @var bool|null
53: */
54: public ?bool $skipAuthentication = null;
55:
56: /**
57: * @var string|null
58: */
59: public ?string $transactionRiskLevel = null;
60:
61: /**
62: * @return object
63: */
64: public function toObject(): object
65: {
66: $object = parent::toObject();
67: if (!is_null($this->authenticationAmount)) {
68: $object->authenticationAmount = $this->authenticationAmount->toObject();
69: }
70: if (!is_null($this->authenticationFlow)) {
71: $object->authenticationFlow = $this->authenticationFlow;
72: }
73: if (!is_null($this->challengeCanvasSize)) {
74: $object->challengeCanvasSize = $this->challengeCanvasSize;
75: }
76: if (!is_null($this->challengeIndicator)) {
77: $object->challengeIndicator = $this->challengeIndicator;
78: }
79: if (!is_null($this->exemptionRequest)) {
80: $object->exemptionRequest = $this->exemptionRequest;
81: }
82: if (!is_null($this->priorThreeDSecureData)) {
83: $object->priorThreeDSecureData = $this->priorThreeDSecureData->toObject();
84: }
85: if (!is_null($this->sdkData)) {
86: $object->sdkData = $this->sdkData->toObject();
87: }
88: if (!is_null($this->skipAuthentication)) {
89: $object->skipAuthentication = $this->skipAuthentication;
90: }
91: if (!is_null($this->transactionRiskLevel)) {
92: $object->transactionRiskLevel = $this->transactionRiskLevel;
93: }
94: return $object;
95: }
96:
97: /**
98: * @param object $object
99: *
100: * @return $this
101: * @throws UnexpectedValueException
102: */
103: public function fromObject(object $object): AbstractThreeDSecure
104: {
105: parent::fromObject($object);
106: if (property_exists($object, 'authenticationAmount')) {
107: if (!is_object($object->authenticationAmount)) {
108: throw new UnexpectedValueException('value \'' . print_r($object->authenticationAmount, true) . '\' is not an object');
109: }
110: $value = new AmountOfMoney();
111: $this->authenticationAmount = $value->fromObject($object->authenticationAmount);
112: }
113: if (property_exists($object, 'authenticationFlow')) {
114: $this->authenticationFlow = $object->authenticationFlow;
115: }
116: if (property_exists($object, 'challengeCanvasSize')) {
117: $this->challengeCanvasSize = $object->challengeCanvasSize;
118: }
119: if (property_exists($object, 'challengeIndicator')) {
120: $this->challengeIndicator = $object->challengeIndicator;
121: }
122: if (property_exists($object, 'exemptionRequest')) {
123: $this->exemptionRequest = $object->exemptionRequest;
124: }
125: if (property_exists($object, 'priorThreeDSecureData')) {
126: if (!is_object($object->priorThreeDSecureData)) {
127: throw new UnexpectedValueException('value \'' . print_r($object->priorThreeDSecureData, true) . '\' is not an object');
128: }
129: $value = new ThreeDSecureData();
130: $this->priorThreeDSecureData = $value->fromObject($object->priorThreeDSecureData);
131: }
132: if (property_exists($object, 'sdkData')) {
133: if (!is_object($object->sdkData)) {
134: throw new UnexpectedValueException('value \'' . print_r($object->sdkData, true) . '\' is not an object');
135: }
136: $value = new SdkDataInput();
137: $this->sdkData = $value->fromObject($object->sdkData);
138: }
139: if (property_exists($object, 'skipAuthentication')) {
140: $this->skipAuthentication = $object->skipAuthentication;
141: }
142: if (property_exists($object, 'transactionRiskLevel')) {
143: $this->transactionRiskLevel = $object->transactionRiskLevel;
144: }
145: return $this;
146: }
147: }
148: