src/Checkout/Checkout.php
public function getSelectedPaymentMethod($nice = false)
    {
        $methods = GatewayInfo::getSupportedGateways();
        reset($methods);
        $method = count($methods) === 1 ? key($methods) : ShopTools::getSession()->get('Checkout.PaymentMethod');
        if ($nice && isset($methods[$method])) {
            $method = $methods[$method];
        }
        return $method;
    }
public function getSelectedPaymentMethod($nice = false)
    {
        $methods = GatewayInfo::getSupportedGateways();
        reset($methods);
        $method = count($methods) === 1 ? key($methods) : ShopTools::getSession()->get('Checkout.PaymentMethod');
        if ($nice && isset($methods[$method])) {
            $method = $methods[$method];
        }
        return $method;
    }
Gets the selected payment method from the session,
or the only available method, if there is only one.

@throws \SilverStripe\Omnipay\Exception\InvalidConfigurationException