<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class DeviceCheckoutOptions implements \JsonSerializable { private $deviceId; private $skipReceiptScreen; private $collectSignature; private $tipSettings; private $showItemizedCart; public function __construct(string $deviceId) { $this->deviceId = $deviceId; } public function getDeviceId(): string { return $this->deviceId; } public function setDeviceId(string $deviceId): void { $this->deviceId = $deviceId; } public function getSkipReceiptScreen(): ?bool { return $this->skipReceiptScreen; } public function setSkipReceiptScreen(?bool $skipReceiptScreen): void { $this->skipReceiptScreen = $skipReceiptScreen; } public function getCollectSignature(): ?bool { return $this->collectSignature; } public function setCollectSignature(?bool $collectSignature): void { $this->collectSignature = $collectSignature; } public function getTipSettings(): ?TipSettings { return $this->tipSettings; } public function setTipSettings(?TipSettings $tipSettings): void { $this->tipSettings = $tipSettings; } public function getShowItemizedCart(): ?bool { return $this->showItemizedCart; } public function setShowItemizedCart(?bool $showItemizedCart): void { $this->showItemizedCart = $showItemizedCart; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['device_id'] = $this->deviceId; if (isset($this->skipReceiptScreen)) { $json['skip_receipt_screen'] = $this->skipReceiptScreen; } if (isset($this->collectSignature)) { $json['collect_signature'] = $this->collectSignature; } if (isset($this->tipSettings)) { $json['tip_settings'] = $this->tipSettings; } if (isset($this->showItemizedCart)) { $json['show_itemized_cart'] = $this->showItemizedCart; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 