<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class RefundPaymentRequest implements \JsonSerializable { private $idempotencyKey; private $amountMoney; private $appFeeMoney; private $paymentId; private $reason; private $paymentVersionToken; private $teamMemberId; public function __construct(string $idempotencyKey, Money $amountMoney) { $this->idempotencyKey = $idempotencyKey; $this->amountMoney = $amountMoney; } public function getIdempotencyKey(): string { return $this->idempotencyKey; } public function setIdempotencyKey(string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getAmountMoney(): Money { return $this->amountMoney; } public function setAmountMoney(Money $amountMoney): void { $this->amountMoney = $amountMoney; } public function getAppFeeMoney(): ?Money { return $this->appFeeMoney; } public function setAppFeeMoney(?Money $appFeeMoney): void { $this->appFeeMoney = $appFeeMoney; } public function getPaymentId(): ?string { return $this->paymentId; } public function setPaymentId(?string $paymentId): void { $this->paymentId = $paymentId; } public function getReason(): ?string { return $this->reason; } public function setReason(?string $reason): void { $this->reason = $reason; } public function getPaymentVersionToken(): ?string { return $this->paymentVersionToken; } public function setPaymentVersionToken(?string $paymentVersionToken): void { $this->paymentVersionToken = $paymentVersionToken; } public function getTeamMemberId(): ?string { return $this->teamMemberId; } public function setTeamMemberId(?string $teamMemberId): void { $this->teamMemberId = $teamMemberId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['idempotency_key'] = $this->idempotencyKey; $json['amount_money'] = $this->amountMoney; if (isset($this->appFeeMoney)) { $json['app_fee_money'] = $this->appFeeMoney; } if (isset($this->paymentId)) { $json['payment_id'] = $this->paymentId; } if (isset($this->reason)) { $json['reason'] = $this->reason; } if (isset($this->paymentVersionToken)) { $json['payment_version_token'] = $this->paymentVersionToken; } if (isset($this->teamMemberId)) { $json['team_member_id'] = $this->teamMemberId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 