<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class PaymentOptions implements \JsonSerializable { private $autocomplete; private $delayDuration; private $acceptPartialAuthorization; public function getAutocomplete(): ?bool { return $this->autocomplete; } public function setAutocomplete(?bool $autocomplete): void { $this->autocomplete = $autocomplete; } public function getDelayDuration(): ?string { return $this->delayDuration; } public function setDelayDuration(?string $delayDuration): void { $this->delayDuration = $delayDuration; } public function getAcceptPartialAuthorization(): ?bool { return $this->acceptPartialAuthorization; } public function setAcceptPartialAuthorization(?bool $acceptPartialAuthorization): void { $this->acceptPartialAuthorization = $acceptPartialAuthorization; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->autocomplete)) { $json['autocomplete'] = $this->autocomplete; } if (isset($this->delayDuration)) { $json['delay_duration'] = $this->delayDuration; } if (isset($this->acceptPartialAuthorization)) { $json['accept_partial_authorization'] = $this->acceptPartialAuthorization; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 