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