Get default payment method

@return array
@codeCoverageIgnore
328251
public function getDefaultMethod()
    {
        return $this->scopeConfig->getValue(
            self::XML_PAYMENT_DEFAULT_METHOD,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
991141
public function getTermsOfPayment()
    {
        if ($terms = $this->entity->getTermsOfPayment()) {
            return array(
                'id' => $terms->getId(),
                'terms' => $terms->getTerms()
            );
        }

        return null;
    }
85853
public function getDefault()
    {
        if ($this->reflection->isDefaultValueAvailable()
            and $default = $this->reflection->getDefaultValue()
        ) {
            if (is_scalar($default)) {
                return $default;
            } else {
                return $this->tostring($default);
            }
        }
        if ($this->reflection->isArray()) {
            return '[]';
        }
        if ($this->isPassedByReference()) {
            return 'null';
        } elseif ($this->reflection->getClass()) {
            // This gets injected as a new instance.
            return null;
        }
        $type = $this->getType();
        if (!$type) {
            $type = $this->extractParameterData();
        }
        // Guesstimated values:
        switch ($type) {
            case 'int': case 'integer': case 'float':
                return 0;
            case 'string':
                return "''";
            case 'array':
                return '[]';
        }
        return null;
    }
982136
public function retrieveAllPaymentmethods()
    {
        if (isset($this->_paymentMethodsArray))
            return $this;

        $obj = new stdClass();
        // Must be in specific order for checksum ---------
        $obj->MerchantID = $this->_merchantID;
        $obj->SecretCode = $this->_secretCode;
        $obj->Timestamp = $this->getTimeStamp();
        // ------------------------------------------------
        $obj->Checksum = $this->generateChecksum($obj);
        $obj->SecretCode = null;

        $this->_paymentMethods = $this->client->GetMyPaymentMethods(array('request' => $obj));

        if (isset($this->_paymentMethods->GetMyPaymentMethodsResult->PaymentMethods->PaymentMethod)) {
            $this->_paymentMethodsArray = $this->clean($this->_paymentMethods);
        }

        return $this;
    }
1035727
public function getPaymentType()
    {
        if ($this->oxorder__oxpaymentid->value && $this->_oPaymentType === null) {
            $this->_oPaymentType = false;
            $oPaymentType = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
            if ($oPaymentType->load($this->oxorder__oxpaymentid->value)) {
                $this->_oPaymentType = $oPaymentType;
            }
        }

        return $this->_oPaymentType;
    }
1221616
public function getPaymentMethodInstance()
    {
        if (is_null($this->_paymentMethodInstance)) {
            $methodCode = $this->getMethodCode();
            if ($this->getMethodCode() == 'adyen_oneclick') {
                $referenceId = $this->getReferenceId();
                $methodInstanceName = $methodCode . "_" . $referenceId;
            } else {
                $methodInstanceName = $methodCode;
            }

            $this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($methodInstanceName);

            if (!$this->_paymentMethodInstance) {
                $this->_paymentMethodInstance = Mage::helper('payment')->getMethodInstance($this->getMethodCode());
            }
        }

        if ($this->_paymentMethodInstance) {
            $this->_paymentMethodInstance->setStore($this->getStoreId());
        }

        return $this->_paymentMethodInstance;
    }
851502
protected function getPaymentMethodsCheckout()
    {
        $list = $this->payment->getList(array('status' => true));
        $this->prepareMethodsCheckout($list);
        return $list;
    }
809873
public function getDefaultSorting()
    {
        $sorting = parent::getDefaultSorting();

        $category = $this->getActiveCategory();
        if ($category && $category instanceof \OxidEsales\Eshop\Application\Model\Category) {
            if ($defaultSorting = $category->getDefaultSorting()) {
                $articleViewName = getViewName('oxarticles');
                $sortBy = $articleViewName . '.' . $defaultSorting;
                $sortDirection = ($category->getDefaultSortingMode()) ? "desc" : "asc";
                $sorting = ['sortby' => $sortBy, 'sortdir' => $sortDirection];
            }
        }

        return $sorting;
    }
918968
public function getUserPayments()
    {
        if ($this->_oUserPayments == null) {
            $this->_oUserPayments = false;
            if ($oUser = $this->getUser()) {
                $sTplLang = \OxidEsales\Eshop\Core\Registry::getLang()->getObjectTplLanguage();
                $sPaymentId = $this->getPaymentId();
                $this->_oUserPayments = $oUser->getUserPayments();
                // generate selected
                foreach ($this->_oUserPayments as $oUserPayment) {
                    $oPayment = oxNew(\OxidEsales\Eshop\Application\Model\Payment::class);
                    $oPayment->setLanguage($sTplLang);
                    $oPayment->load($oUserPayment->oxuserpayments__oxpaymentsid->value);
                    $oUserPayment->oxpayments__oxdesc = clone $oPayment->oxpayments__oxdesc;
                    if ($oUserPayment->oxuserpayments__oxid->value == $sPaymentId) {
                        $oUserPayment->selected = 1;
                        break;
                    }
                }
            }
        }

        return $this->_oUserPayments;
    }
913078
public function &GetPaymentHandler()
    {
        $oPaymentHandler = $this->GetFromInternalCache('oOrderPaymentHandler');
        if (is_null($oPaymentHandler)) {
            $oPaymentMethod = $this->GetFieldShopPaymentMethod();
            if ($oPaymentMethod) {
                $aParameter = array();
                $oPaymentParameterList = $this->GetFieldShopOrderPaymentMethodParameterList();
                while ($oParam = $oPaymentParameterList->Next()) {
                    $aParameter[$oParam->fieldName] = $oParam->fieldValue;
                }
                try {
                    $oPaymentHandler = $this->getShopPaymentHandlerFactory()->createPaymentHandler($oPaymentMethod->fieldShopPaymentHandlerId, $this->fieldCmsPortalId, $aParameter);
                    $this->SetInternalCache('oOrderPaymentHandler', $oPaymentHandler);
                } catch (ConfigurationException $e) {
                    $this->getLogger()->error(
                        sprintf('Unable to create payment handler: %s', $e->getMessage()),
                        [
                            'paymentHandlerId' => $oPaymentMethod->fieldShopPaymentHandlerId,
                            'portalId' => $this->fieldCmsPortalId,
                        ]
                    );
                }
            }
        }

        return $oPaymentHandler;
    }
1285626
public function getPaymentMethod()
    {
        try {
            return $this->getOrder()->source->getPayment()->getMethod();
        }
        catch (\Exception $e) {}
        return parent::getPaymentMethod();
    }
330973
protected function GetUserPaymentData()
    {
        $oGlobal = TGlobal::instance();
        if ($oGlobal->UserDataExists(TdbShopPaymentHandler::URL_PAYMENT_USER_INPUT)) {
            $this->aPaymentUserData = $oGlobal->GetUserData(TdbShopPaymentHandler::URL_PAYMENT_USER_INPUT);
            if (!is_array($this->aPaymentUserData)) {
                $this->aPaymentUserData = array();
            }
        } elseif (is_null($this->aPaymentUserData)) {
            $this->aPaymentUserData = $this->GetDefaultUserPaymentData();
        }

        return $this->aPaymentUserData;
    }
983608
public function getDefaultParameters()
    {
        return [
            'vendor' => null,
            'testMode' => false,
            'referrerId' => null,
            'language' => null,
            'useOldBasketFormat' => false,
            'exitOnResponse' => false,
            'apply3DSecure' => null,
            'useAuthenticate' => null,
            'accountType' => null,
        ];
    }
1129470
public function getPaymentMethods()
    {
        $result = array();

        foreach ($this->data->gateways->gateway as $gateway) {
            $result[(string) $gateway->id] = (string) $gateway->description;
        }

        return $result;
    }
1023875
protected function getPaymentData()
    {
        $data = array(
            'cancel_url'   => $this->getCancelUrl(),
            'close_window' => $this->getCloseWindow(),
            'notification_url' => $this->getNotifyUrl(),
            'redirect_url'   => $this->getReturnUrl(),
        );

        return array_filter($data);
    }
840967
protected function getPayPalPayment()
    {
        $userPayment = null;

        if (($order = $this->getPayPalOrder())) {
            $userPayment = oxNew(\OxidEsales\Eshop\Application\Model\UserPayment::class);
            $userPayment->load($order->oxorder__oxpaymentid->value);
        }

        return $userPayment;
    }
1373574
protected static function getDefaultService()
    {
        $service = (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        $parts = parse_url($service);

        if (isset($parts['query'])) {
            parse_str($parts['query'], $query);
        } else {
            $query = array();
        }
        unset($query['ticket']);
        $parts['query'] = http_build_query($query);

        return self::build_url($parts);
    }