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