Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace Hostinger\Reach\Dto;

use WC_Order;

class Totals {

    private float $total;
    private float $subtotal;
    private float $tax_total;
    private float $shipping_total;
    private float $discount_total;
    private string $currency;

    public function __construct( float $total, float $subtotal, float $tax_total, float $shipping_total, float $discount_total, string $currency ) {
        $this->total          = $total;
        $this->subtotal       = $subtotal;
        $this->tax_total      = $tax_total;
        $this->shipping_total = $shipping_total;
        $this->discount_total = $discount_total;
        $this->currency       = $currency;
    }

    public function to_array(): array {
        return array(
            'total'          => $this->total,
            'subtotal'       => $this->subtotal,
            'tax_total'      => $this->tax_total,
            'shipping_total' => $this->shipping_total,
            'discount_total' => $this->discount_total,
            'currency'       => $this->currency,
        );
    }

    public static function from_order( WC_Order $order ): self {
        return new self(
            $order->get_total(),
            $order->get_subtotal(