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