public function TotalPaidOrAuthorized()
    {
        $paid = 0;

        if ($payments = $this->owner->Payments()) {
            foreach ($payments as $payment) {
                // Captured and authorized payments
                // (which aren't manual) should count towards the total
                $captured = $payment->Status == 'Captured';
                $authorized = $payment->Status == 'Authorized' && !GatewayInfo::isManual($payment->Gateway);

                if ($captured || $authorized) {
                    $paid += $payment->Amount;
                }
            }
        }

        return $paid;
    }