<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Tender implements \JsonSerializable { private $id; private $locationId; private $transactionId; private $createdAt; private $note; private $amountMoney; private $tipMoney; private $processingFeeMoney; private $customerId; private $type; private $cardDetails; private $cashDetails; private $additionalRecipients; private $paymentId; public function __construct(string $type) { $this->type = $type; } 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 getTransactionId(): ?string { return $this->transactionId; } public function setTransactionId(?string $transactionId): void { $this->transactionId = $transactionId; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getNote(): ?string { return $this->note; } public function setNote(?string $note): void { $this->note = $note; } public function getAmountMoney(): ?Money { return $this->amountMoney; } public function setAmountMoney(?Money $amountMoney): void { $this->amountMoney = $amountMoney; } public function getTipMoney(): ?Money { return $this->tipMoney; } public function setTipMoney(?Money $tipMoney): void { $this->tipMoney = $tipMoney; } public function getProcessingFeeMoney(): ?Money { return $this->processingFeeMoney; } public function setProcessingFeeMoney(?Money $processingFeeMoney): void { $this->processingFeeMoney = $processingFeeMoney; } public function getCustomerId(): ?string { return $this->customerId; } public function setCustomerId(?string $customerId): void { $this->customerId = $customerId; } public function getType(): string { return $this->type; } public function setType(string $type): void { $this->type = $type; } public function getCardDetails(): ?TenderCardDetails { return $this->cardDetails; } public function setCardDetails(?TenderCardDetails $cardDetails): void { $this->cardDetails = $cardDetails; } public function getCashDetails(): ?TenderCashDetails { return $this->cashDetails; } public function setCashDetails(?TenderCashDetails $cashDetails): void { $this->cashDetails = $cashDetails; } public function getAdditionalRecipients(): ?array { return $this->additionalRecipients; } public function setAdditionalRecipients(?array $additionalRecipients): void { $this->additionalRecipients = $additionalRecipients; } public function getPaymentId(): ?string { return $this->paymentId; } public function setPaymentId(?string $paymentId): void { $this->paymentId = $paymentId; } #[\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->transactionId)) { $json['transaction_id'] = $this->transactionId; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->note)) { $json['note'] = $this->note; } if (isset($this->amountMoney)) { $json['amount_money'] = $this->amountMoney; } if (isset($this->tipMoney)) { $json['tip_money'] = $this->tipMoney; } if (isset($this->processingFeeMoney)) { $json['processing_fee_money'] = $this->processingFeeMoney; } if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; } $json['type'] = $this->type; if (isset($this->cardDetails)) { $json['card_details'] = $this->cardDetails; } if (isset($this->cashDetails)) { $json['cash_details'] = $this->cashDetails; } if (isset($this->additionalRecipients)) { $json['additional_recipients'] = $this->additionalRecipients; } if (isset($this->paymentId)) { $json['payment_id'] = $this->paymentId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 