source/Application/Model/Order.php
private function isValidPaymentId($paymentId)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = DatabaseProvider::getMaster();

        $paymentModel = oxNew(EshopPayment::class);
        $tableName = $paymentModel->getViewName();

        $sql = "
            select
                1 
            from 
                {$tableName}
            where 
                {$tableName}.oxid = {$masterDb->quote($paymentId)}
                and {$paymentModel->getSqlActiveSnippet()}
        ";

        return (bool) $masterDb->getOne($sql);
    }
private function isValidPaymentId($paymentId)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = DatabaseProvider::getMaster();

        $paymentModel = oxNew(EshopPayment::class);
        $tableName = $paymentModel->getViewName();

        $sql = "
            select
                1 
            from 
                {$tableName}
            where 
                {$tableName}.oxid = {$masterDb->quote($paymentId)}
                and {$paymentModel->getSqlActiveSnippet()}
        ";

        return (bool) $masterDb->getOne($sql);
    }
private function isValidPaymentId ( $ paymentId ) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $ masterDb = DatabaseProvider :: getMaster ( ) ; $ paymentModel = oxNew ( EshopPayment :: class ) ; $ tableName = $ paymentModel -> getViewName ( ) ; $ sql = "
            select
                1 
            from 
                {$tableName}
            where 
                {$tableName}.oxid = {$masterDb->quote($paymentId)}
                and {$paymentModel->getSqlActiveSnippet()}
        " ; return ( bool ) $ masterDb -> getOne ( $ sql ) ; }
Returns true if paymentId is valid.

@param int $paymentId

@return bool
Returns true if paymentId is valid .