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 $offlineAuthorizationResponseCode = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $pinEntryCapability = null;
49:
50: /**
51: * @var string|null
52: */
53: public ?string $terminalId = null;
54:
55: /**
56: * @var string|null
57: */
58: public ?string $terminalLocation = null;
59:
60: /**
61: * @return object
62: */
63: public function toObject(): object
64: {
65: $object = parent::toObject();
66: if (!is_null($this->allowSingleTap)) {
67: $object->allowSingleTap = $this->allowSingleTap;
68: }
69: if (!is_null($this->cardReadingCapabilities)) {
70: $object->cardReadingCapabilities = [];
71: foreach ($this->cardReadingCapabilities as $element) {
72: if (!is_null($element)) {
73: $object->cardReadingCapabilities[] = $element;
74: }
75: }
76: }
77: if (!is_null($this->cardholderActivatedTerminalLevel)) {
78: $object->cardholderActivatedTerminalLevel = $this->cardholderActivatedTerminalLevel;
79: }
80: if (!is_null($this->isAttendedTerminal)) {
81: $object->isAttendedTerminal = $this->isAttendedTerminal;
82: }
83: if (!is_null($this->isOfflineApproved)) {
84: $object->isOfflineApproved = $this->isOfflineApproved;
85: }
86: if (!is_null($this->offlineAuthorizationResponseCode)) {
87: $object->offlineAuthorizationResponseCode = $this->offlineAuthorizationResponseCode;
88: }
89: if (!is_null($this->pinEntryCapability)) {
90: $object->pinEntryCapability = $this->pinEntryCapability;
91: }
92: if (!is_null($this->terminalId)) {
93: $object->terminalId = $this->terminalId;
94: }
95: if (!is_null($this->terminalLocation)) {
96: $object->terminalLocation = $this->terminalLocation;
97: }
98: return $object;
99: }
100:
101: /**
102: * @param object $object
103: *
104: * @return $this
105: * @throws UnexpectedValueException
106: */
107: public function fromObject(object $object): TerminalData
108: {
109: parent::fromObject($object);
110: if (property_exists($object, 'allowSingleTap')) {
111: $this->allowSingleTap = $object->allowSingleTap;
112: }
113: if (property_exists($object, 'cardReadingCapabilities')) {
114: if (!is_array($object->cardReadingCapabilities) && !is_object($object->cardReadingCapabilities)) {
115: throw new UnexpectedValueException('value \'' . print_r($object->cardReadingCapabilities, true) . '\' is not an array or object');
116: }
117: $this->cardReadingCapabilities = [];
118: foreach ($object->cardReadingCapabilities as $element) {
119: $this->cardReadingCapabilities[] = $element;
120: }
121: }
122: if (property_exists($object, 'cardholderActivatedTerminalLevel')) {
123: $this->cardholderActivatedTerminalLevel = $object->cardholderActivatedTerminalLevel;
124: }
125: if (property_exists($object, 'isAttendedTerminal')) {
126: $this->isAttendedTerminal = $object->isAttendedTerminal;
127: }
128: if (property_exists($object, 'isOfflineApproved')) {
129: $this->isOfflineApproved = $object->isOfflineApproved;
130: }
131: if (property_exists($object, 'offlineAuthorizationResponseCode')) {
132: $this->offlineAuthorizationResponseCode = $object->offlineAuthorizationResponseCode;
133: }
134: if (property_exists($object, 'pinEntryCapability')) {
135: $this->pinEntryCapability = $object->pinEntryCapability;
136: }
137: if (property_exists($object, 'terminalId')) {
138: $this->terminalId = $object->terminalId;
139: }
140: if (property_exists($object, 'terminalLocation')) {
141: $this->terminalLocation = $object->terminalLocation;
142: }
143: return $this;
144: }
145: }
146: