OpenXE/classes/Carrier/Go/Data/MoneyValue.php
2025-01-03 21:15:18 +01:00

20 lines
467 B
PHP

<?php
// SPDX-FileCopyrightText: 2025 Andreas Palm
//
// SPDX-License-Identifier: AGPL-3.0-only
namespace Xentral\Carrier\Go\Data;
class MoneyValue implements \JsonSerializable {
public float $amount = 0;
public string $currency = 'EUR';
public function jsonSerialize()
{
return [
'amount' => $this->amount > 0 ? (string)$this->amount : '',
'currency' => $this->amount > 0 ? $this->currency : '',
];
}
}