public static function getSupportedGateways($nice = true)
    {
        $allowed = Payment::config()->allowed_gateways;

        if (!is_array($allowed) || empty($allowed)) {
            throw new InvalidConfigurationException(
                'No allowed gateways configured. Use SilverStripe\Omnipay\Model\Payment.allowed_gateways config.'
            );
        }

        $allowed = array_combine($allowed, $allowed);

        if ($nice) {
            $allowed = array_map('SilverStripe\Omnipay\GatewayInfo::niceTitle', $allowed);
        }

        return $allowed;
    }