<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class TenderCashDetails implements \JsonSerializable { private $buyerTenderedMoney; private $changeBackMoney; public function getBuyerTenderedMoney(): ?Money { return $this->buyerTenderedMoney; } public function setBuyerTenderedMoney(?Money $buyerTenderedMoney): void { $this->buyerTenderedMoney = $buyerTenderedMoney; } public function getChangeBackMoney(): ?Money { return $this->changeBackMoney; } public function setChangeBackMoney(?Money $changeBackMoney): void { $this->changeBackMoney = $changeBackMoney; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->buyerTenderedMoney)) { $json['buyer_tendered_money'] = $this->buyerTenderedMoney; } if (isset($this->changeBackMoney)) { $json['change_back_money'] = $this->changeBackMoney; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 