<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class V1PaymentSurcharge implements \JsonSerializable { private $name; private $appliedMoney; private $rate; private $amountMoney; private $type; private $taxable; private $taxes; private $surchargeId; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getAppliedMoney(): ?V1Money { return $this->appliedMoney; } public function setAppliedMoney(?V1Money $appliedMoney): void { $this->appliedMoney = $appliedMoney; } public function getRate(): ?string { return $this->rate; } public function setRate(?string $rate): void { $this->rate = $rate; } public function getAmountMoney(): ?V1Money { return $this->amountMoney; } public function setAmountMoney(?V1Money $amountMoney): void { $this->amountMoney = $amountMoney; } public function getType(): ?string { return $this->type; } public function setType(?string $type): void { $this->type = $type; } public function getTaxable(): ?bool { return $this->taxable; } public function setTaxable(?bool $taxable): void { $this->taxable = $taxable; } public function getTaxes(): ?array { return $this->taxes; } public function setTaxes(?array $taxes): void { $this->taxes = $taxes; } public function getSurchargeId(): ?string { return $this->surchargeId; } public function setSurchargeId(?string $surchargeId): void { $this->surchargeId = $surchargeId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->appliedMoney)) { $json['applied_money'] = $this->appliedMoney; } if (isset($this->rate)) { $json['rate'] = $this->rate; } if (isset($this->amountMoney)) { $json['amount_money'] = $this->amountMoney; } if (isset($this->type)) { $json['type'] = $this->type; } if (isset($this->taxable)) { $json['taxable'] = $this->taxable; } if (isset($this->taxes)) { $json['taxes'] = $this->taxes; } if (isset($this->surchargeId)) { $json['surcharge_id'] = $this->surchargeId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 