source/Application/Model/Payment.php
public function isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if ($this->oxpayments__oxid->value == 'oxempty') {
            // inactive or blOtherCountryOrder is off
            if (!$this->oxpayments__oxactive->value || !$myConfig->getConfigParam("blOtherCountryOrder")) {
                $this->_iPaymentError = -2;

                return false;
            }
            if (count(
                \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliverySetList::class)
                    ->getDeliverySetList(
                        $oUser,
                        $oUser->getActiveCountry()
                    )
            )
            ) {
                $this->_iPaymentError = -3;

                return false;
            }

            return true;
        }

        $mxValidationResult = \OxidEsales\Eshop\Core\Registry::getInputValidator()->validatePaymentInputData($this->oxpayments__oxid->value, $aDynValue);

        if (is_integer($mxValidationResult)) {
            $this->_iPaymentError = $mxValidationResult;

            return false;
        } elseif ($mxValidationResult === false) {
            $this->_iPaymentError = 1;

            return false;
        }

        $oCur = $myConfig->getActShopCurrencyObject();
        $dBasketPrice = $dBasketPrice / $oCur->rate;

        if ($sShipSetId) {
            $aPaymentList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\PaymentList::class)->getPaymentList($sShipSetId, $dBasketPrice, $oUser);

            if (!array_key_exists($this->getId(), $aPaymentList)) {
                $this->_iPaymentError = -3;

                return false;
            }
        } else {
            $this->_iPaymentError = -2;

            return false;
        }

        return true;
    }
public function isValidPayment($aDynValue, $sShopId, $oUser, $dBasketPrice, $sShipSetId)
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        if ($this->oxpayments__oxid->value == 'oxempty') {
            // inactive or blOtherCountryOrder is off
            if (!$this->oxpayments__oxactive->value || !$myConfig->getConfigParam("blOtherCountryOrder")) {
                $this->_iPaymentError = -2;

                return false;
            }
            if (count(
                \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliverySetList::class)
                    ->getDeliverySetList(
                        $oUser,
                        $oUser->getActiveCountry()
                    )
            )
            ) {
                $this->_iPaymentError = -3;

                return false;
            }

            return true;
        }

        $mxValidationResult = \OxidEsales\Eshop\Core\Registry::getInputValidator()->validatePaymentInputData($this->oxpayments__oxid->value, $aDynValue);

        if (is_integer($mxValidationResult)) {
            $this->_iPaymentError = $mxValidationResult;

            return false;
        } elseif ($mxValidationResult === false) {
            $this->_iPaymentError = 1;

            return false;
        }

        $oCur = $myConfig->getActShopCurrencyObject();
        $dBasketPrice = $dBasketPrice / $oCur->rate;

        if ($sShipSetId) {
            $aPaymentList = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\PaymentList::class)->getPaymentList($sShipSetId, $dBasketPrice, $oUser);

            if (!array_key_exists($this->getId(), $aPaymentList)) {
                $this->_iPaymentError = -3;

                return false;
            }
        } else {
            $this->_iPaymentError = -2;

            return false;
        }

        return true;
    }
public function isValidPayment ( $ aDynValue , $ sShopId , $ oUser , $ dBasketPrice , $ sShipSetId ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; if ( $ this -> oxpayments__oxid -> value == 'oxempty' ) { // inactive or blOtherCountryOrder is off if ( ! $ this -> oxpayments__oxactive -> value || ! $ myConfig -> getConfigParam ( "blOtherCountryOrder" ) ) { $ this -> _iPaymentError = - 2 ; return false ; } if ( count ( \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ DeliverySetList :: class ) -> getDeliverySetList ( $ oUser , $ oUser -> getActiveCountry ( ) ) ) ) { $ this -> _iPaymentError = - 3 ; return false ; } return true ; } $ mxValidationResult = \ OxidEsales \ Eshop \ Core \ Registry :: getInputValidator ( ) -> validatePaymentInputData ( $ this -> oxpayments__oxid -> value , $ aDynValue ) ; if ( is_integer ( $ mxValidationResult ) ) { $ this -> _iPaymentError = $ mxValidationResult ; return false ; } elseif ( $ mxValidationResult === false ) { $ this -> _iPaymentError = 1 ; return false ; } $ oCur = $ myConfig -> getActShopCurrencyObject ( ) ; $ dBasketPrice = $ dBasketPrice / $ oCur -> rate ; if ( $ sShipSetId ) { $ aPaymentList = \ OxidEsales \ Eshop \ Core \ Registry :: get ( \ OxidEsales \ Eshop \ Application \ Model \ PaymentList :: class ) -> getPaymentList ( $ sShipSetId , $ dBasketPrice , $ oUser ) ; if ( ! array_key_exists ( $ this -> getId ( ) , $ aPaymentList ) ) { $ this -> _iPaymentError = - 3 ; return false ; } } else { $ this -> _iPaymentError = - 2 ; return false ; } return true ; }
Function checks if loaded payment is valid to current basket

@param array                                    $aDynValue    dynamical value (in this case oxidcreditcard and oxiddebitnote are checked only)
@param string                                   $sShopId      id of current shop
@param \OxidEsales\Eshop\Application\Model\User $oUser        the current user
@param double                                   $dBasketPrice the current basket price (oBasket->dPrice)
@param string                                   $sShipSetId   the current ship set

@return bool true if payment is valid
Function checks if loaded payment is valid to current basket