<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Checkout implements \JsonSerializable { private $id; private $checkoutPageUrl; private $askForShippingAddress; private $merchantSupportEmail; private $prePopulateBuyerEmail; private $prePopulateShippingAddress; private $redirectUrl; private $order; private $createdAt; private $additionalRecipients; public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getCheckoutPageUrl(): ?string { return $this->checkoutPageUrl; } public function setCheckoutPageUrl(?string $checkoutPageUrl): void { $this->checkoutPageUrl = $checkoutPageUrl; } public function getAskForShippingAddress(): ?bool { return $this->askForShippingAddress; } public function setAskForShippingAddress(?bool $askForShippingAddress): void { $this->askForShippingAddress = $askForShippingAddress; } public function getMerchantSupportEmail(): ?string { return $this->merchantSupportEmail; } public function setMerchantSupportEmail(?string $merchantSupportEmail): void { $this->merchantSupportEmail = $merchantSupportEmail; } public function getPrePopulateBuyerEmail(): ?string { return $this->prePopulateBuyerEmail; } public function setPrePopulateBuyerEmail(?string $prePopulateBuyerEmail): void { $this->prePopulateBuyerEmail = $prePopulateBuyerEmail; } public function getPrePopulateShippingAddress(): ?Address { return $this->prePopulateShippingAddress; } public function setPrePopulateShippingAddress(?Address $prePopulateShippingAddress): void { $this->prePopulateShippingAddress = $prePopulateShippingAddress; } public function getRedirectUrl(): ?string { return $this->redirectUrl; } public function setRedirectUrl(?string $redirectUrl): void { $this->redirectUrl = $redirectUrl; } public function getOrder(): ?Order { return $this->order; } public function setOrder(?Order $order): void { $this->order = $order; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getAdditionalRecipients(): ?array { return $this->additionalRecipients; } public function setAdditionalRecipients(?array $additionalRecipients): void { $this->additionalRecipients = $additionalRecipients; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->checkoutPageUrl)) { $json['checkout_page_url'] = $this->checkoutPageUrl; } if (isset($this->askForShippingAddress)) { $json['ask_for_shipping_address'] = $this->askForShippingAddress; } if (isset($this->merchantSupportEmail)) { $json['merchant_support_email'] = $this->merchantSupportEmail; } if (isset($this->prePopulateBuyerEmail)) { $json['pre_populate_buyer_email'] = $this->prePopulateBuyerEmail; } if (isset($this->prePopulateShippingAddress)) { $json['pre_populate_shipping_address'] = $this->prePopulateShippingAddress; } if (isset($this->redirectUrl)) { $json['redirect_url'] = $this->redirectUrl; } if (isset($this->order)) { $json['order'] = $this->order; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->additionalRecipients)) { $json['additional_recipients'] = $this->additionalRecipients; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 