<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class BuyNowPayLaterDetails implements \JsonSerializable { private $brand; private $afterpayDetails; public function getBrand(): ?string { return $this->brand; } public function setBrand(?string $brand): void { $this->brand = $brand; } public function getAfterpayDetails(): ?AfterpayDetails { return $this->afterpayDetails; } public function setAfterpayDetails(?AfterpayDetails $afterpayDetails): void { $this->afterpayDetails = $afterpayDetails; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->brand)) { $json['brand'] = $this->brand; } if (isset($this->afterpayDetails)) { $json['afterpay_details'] = $this->afterpayDetails; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 