<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class V1CreateRefundRequest implements \JsonSerializable { private $paymentId; private $type; private $reason; private $refundedMoney; private $requestIdempotenceKey; public function __construct(string $paymentId, string $type, string $reason) { $this->paymentId = $paymentId; $this->type = $type; $this->reason = $reason; } public function getPaymentId(): string { return $this->paymentId; } public function setPaymentId(string $paymentId): void { $this->paymentId = $paymentId; } public function getType(): string { return $this->type; } public function setType(string $type): void { $this->type = $type; } public function getReason(): string { return $this->reason; } public function setReason(string $reason): void { $this->reason = $reason; } public function getRefundedMoney(): ?V1Money { return $this->refundedMoney; } public function setRefundedMoney(?V1Money $refundedMoney): void { $this->refundedMoney = $refundedMoney; } public function getRequestIdempotenceKey(): ?string { return $this->requestIdempotenceKey; } public function setRequestIdempotenceKey(?string $requestIdempotenceKey): void { $this->requestIdempotenceKey = $requestIdempotenceKey; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['payment_id'] = $this->paymentId; $json['type'] = $this->type; $json['reason'] = $this->reason; if (isset($this->refundedMoney)) { $json['refunded_money'] = $this->refundedMoney; } if (isset($this->requestIdempotenceKey)) { $json['request_idempotence_key'] = $this->requestIdempotenceKey; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 