<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class AcceptedPaymentMethods implements \JsonSerializable { private $applePay; private $googlePay; private $cashAppPay; private $afterpayClearpay; public function getApplePay(): ?bool { return $this->applePay; } public function setApplePay(?bool $applePay): void { $this->applePay = $applePay; } public function getGooglePay(): ?bool { return $this->googlePay; } public function setGooglePay(?bool $googlePay): void { $this->googlePay = $googlePay; } public function getCashAppPay(): ?bool { return $this->cashAppPay; } public function setCashAppPay(?bool $cashAppPay): void { $this->cashAppPay = $cashAppPay; } public function getAfterpayClearpay(): ?bool { return $this->afterpayClearpay; } public function setAfterpayClearpay(?bool $afterpayClearpay): void { $this->afterpayClearpay = $afterpayClearpay; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->applePay)) { $json['apple_pay'] = $this->applePay; } if (isset($this->googlePay)) { $json['google_pay'] = $this->googlePay; } if (isset($this->cashAppPay)) { $json['cash_app_pay'] = $this->cashAppPay; } if (isset($this->afterpayClearpay)) { $json['afterpay_clearpay'] = $this->afterpayClearpay; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 