<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Transaction implements \JsonSerializable { private $id; private $locationId; private $createdAt; private $tenders; private $refunds; private $referenceId; private $product; private $clientId; private $shippingAddress; private $orderId; public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getTenders(): ?array { return $this->tenders; } public function setTenders(?array $tenders): void { $this->tenders = $tenders; } public function getRefunds(): ?array { return $this->refunds; } public function setRefunds(?array $refunds): void { $this->refunds = $refunds; } public function getReferenceId(): ?string { return $this->referenceId; } public function setReferenceId(?string $referenceId): void { $this->referenceId = $referenceId; } public function getProduct(): ?string { return $this->product; } public function setProduct(?string $product): void { $this->product = $product; } public function getClientId(): ?string { return $this->clientId; } public function setClientId(?string $clientId): void { $this->clientId = $clientId; } public function getShippingAddress(): ?Address { return $this->shippingAddress; } public function setShippingAddress(?Address $shippingAddress): void { $this->shippingAddress = $shippingAddress; } public function getOrderId(): ?string { return $this->orderId; } public function setOrderId(?string $orderId): void { $this->orderId = $orderId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->tenders)) { $json['tenders'] = $this->tenders; } if (isset($this->refunds)) { $json['refunds'] = $this->refunds; } if (isset($this->referenceId)) { $json['reference_id'] = $this->referenceId; } if (isset($this->product)) { $json['product'] = $this->product; } if (isset($this->clientId)) { $json['client_id'] = $this->clientId; } if (isset($this->shippingAddress)) { $json['shipping_address'] = $this->shippingAddress; } if (isset($this->orderId)) { $json['order_id'] = $this->orderId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 