<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class InvoiceAcceptedPaymentMethods implements \JsonSerializable { private $card; private $squareGiftCard; private $bankAccount; public function getCard(): ?bool { return $this->card; } public function setCard(?bool $card): void { $this->card = $card; } public function getSquareGiftCard(): ?bool { return $this->squareGiftCard; } public function setSquareGiftCard(?bool $squareGiftCard): void { $this->squareGiftCard = $squareGiftCard; } public function getBankAccount(): ?bool { return $this->bankAccount; } public function setBankAccount(?bool $bankAccount): void { $this->bankAccount = $bankAccount; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->card)) { $json['card'] = $this->card; } if (isset($this->squareGiftCard)) { $json['square_gift_card'] = $this->squareGiftCard; } if (isset($this->bankAccount)) { $json['bank_account'] = $this->bankAccount; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 