<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CreatePaymentLinkRequest implements \JsonSerializable { private $idempotencyKey; private $description; private $quickPay; private $order; private $checkoutOptions; private $prePopulatedData; private $source; private $paymentNote; public function getIdempotencyKey(): ?string { return $this->idempotencyKey; } public function setIdempotencyKey(?string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): void { $this->description = $description; } public function getQuickPay(): ?QuickPay { return $this->quickPay; } public function setQuickPay(?QuickPay $quickPay): void { $this->quickPay = $quickPay; } public function getOrder(): ?Order { return $this->order; } public function setOrder(?Order $order): void { $this->order = $order; } public function getCheckoutOptions(): ?CheckoutOptions { return $this->checkoutOptions; } public function setCheckoutOptions(?CheckoutOptions $checkoutOptions): void { $this->checkoutOptions = $checkoutOptions; } public function getPrePopulatedData(): ?PrePopulatedData { return $this->prePopulatedData; } public function setPrePopulatedData(?PrePopulatedData $prePopulatedData): void { $this->prePopulatedData = $prePopulatedData; } public function getSource(): ?string { return $this->source; } public function setSource(?string $source): void { $this->source = $source; } public function getPaymentNote(): ?string { return $this->paymentNote; } public function setPaymentNote(?string $paymentNote): void { $this->paymentNote = $paymentNote; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->idempotencyKey)) { $json['idempotency_key'] = $this->idempotencyKey; } if (isset($this->description)) { $json['description'] = $this->description; } if (isset($this->quickPay)) { $json['quick_pay'] = $this->quickPay; } if (isset($this->order)) { $json['order'] = $this->order; } if (isset($this->checkoutOptions)) { $json['checkout_options'] = $this->checkoutOptions; } if (isset($this->prePopulatedData)) { $json['pre_populated_data'] = $this->prePopulatedData; } if (isset($this->source)) { $json['source'] = $this->source; } if (isset($this->paymentNote)) { $json['payment_note'] = $this->paymentNote; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 