<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CreateCustomerCardRequest implements \JsonSerializable { private $cardNonce; private $billingAddress; private $cardholderName; private $verificationToken; public function __construct(string $cardNonce) { $this->cardNonce = $cardNonce; } public function getCardNonce(): string { return $this->cardNonce; } public function setCardNonce(string $cardNonce): void { $this->cardNonce = $cardNonce; } public function getBillingAddress(): ?Address { return $this->billingAddress; } public function setBillingAddress(?Address $billingAddress): void { $this->billingAddress = $billingAddress; } public function getCardholderName(): ?string { return $this->cardholderName; } public function setCardholderName(?string $cardholderName): void { $this->cardholderName = $cardholderName; } public function getVerificationToken(): ?string { return $this->verificationToken; } public function setVerificationToken(?string $verificationToken): void { $this->verificationToken = $verificationToken; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['card_nonce'] = $this->cardNonce; if (isset($this->billingAddress)) { $json['billing_address'] = $this->billingAddress; } if (isset($this->cardholderName)) { $json['cardholder_name'] = $this->cardholderName; } if (isset($this->verificationToken)) { $json['verification_token'] = $this->verificationToken; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 