<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class PayOrderRequest implements \JsonSerializable { private $idempotencyKey; private $orderVersion; private $paymentIds; public function __construct(string $idempotencyKey) { $this->idempotencyKey = $idempotencyKey; } public function getIdempotencyKey(): string { return $this->idempotencyKey; } public function setIdempotencyKey(string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getOrderVersion(): ?int { return $this->orderVersion; } public function setOrderVersion(?int $orderVersion): void { $this->orderVersion = $orderVersion; } public function getPaymentIds(): ?array { return $this->paymentIds; } public function setPaymentIds(?array $paymentIds): void { $this->paymentIds = $paymentIds; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['idempotency_key'] = $this->idempotencyKey; if (isset($this->orderVersion)) { $json['order_version'] = $this->orderVersion; } if (isset($this->paymentIds)) { $json['payment_ids'] = $this->paymentIds; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 