1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class ECommerceData extends DataObject
14: {
15: /**
16: * @var AddressVerificationData|null
17: */
18: public ?AddressVerificationData $addressVerificationData = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $scaExemptionRequest = null;
24:
25: /**
26: * @var ThreeDSecure|null
27: */
28: public ?ThreeDSecure $threeDSecure = null;
29:
30: /**
31: * @return object
32: */
33: public function toObject(): object
34: {
35: $object = parent::toObject();
36: if (!is_null($this->addressVerificationData)) {
37: $object->addressVerificationData = $this->addressVerificationData->toObject();
38: }
39: if (!is_null($this->scaExemptionRequest)) {
40: $object->scaExemptionRequest = $this->scaExemptionRequest;
41: }
42: if (!is_null($this->threeDSecure)) {
43: $object->threeDSecure = $this->threeDSecure->toObject();
44: }
45: return $object;
46: }
47:
48: /**
49: * @param object $object
50: *
51: * @return $this
52: * @throws UnexpectedValueException
53: */
54: public function fromObject(object $object): ECommerceData
55: {
56: parent::fromObject($object);
57: if (property_exists($object, 'addressVerificationData')) {
58: if (!is_object($object->addressVerificationData)) {
59: throw new UnexpectedValueException('value \'' . print_r($object->addressVerificationData, true) . '\' is not an object');
60: }
61: $value = new AddressVerificationData();
62: $this->addressVerificationData = $value->fromObject($object->addressVerificationData);
63: }
64: if (property_exists($object, 'scaExemptionRequest')) {
65: $this->scaExemptionRequest = $object->scaExemptionRequest;
66: }
67: if (property_exists($object, 'threeDSecure')) {
68: if (!is_object($object->threeDSecure)) {
69: throw new UnexpectedValueException('value \'' . print_r($object->threeDSecure, true) . '\' is not an object');
70: }
71: $value = new ThreeDSecure();
72: $this->threeDSecure = $value->fromObject($object->threeDSecure);
73: }
74: return $this;
75: }
76: }
77: