source/Application/Model/Order.php
public function getLastUserPaymentType($sUserId)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $sQ = 'select oxorder.oxpaymenttype from oxorder where oxorder.oxshopid="' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" and oxorder.oxuserid=' . $masterDb->quote($sUserId) . ' order by oxorder.oxorderdate desc ';
        $sLastPaymentId = $masterDb->getOne($sQ);

        return $sLastPaymentId;
    }
public function getLastUserPaymentType($sUserId)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $sQ = 'select oxorder.oxpaymenttype from oxorder where oxorder.oxshopid="' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" and oxorder.oxuserid=' . $masterDb->quote($sUserId) . ' order by oxorder.oxorderdate desc ';
        $sLastPaymentId = $masterDb->getOne($sQ);

        return $sLastPaymentId;
    }
public function getLastUserPaymentType ( $ sUserId ) { // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). $ masterDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) ; $ sQ = 'select oxorder.oxpaymenttype from oxorder where oxorder.oxshopid="' . \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getShopId ( ) . '" and oxorder.oxuserid=' . $ masterDb -> quote ( $ sUserId ) . ' order by oxorder.oxorderdate desc ' ; $ sLastPaymentId = $ masterDb -> getOne ( $ sQ ) ; return $ sLastPaymentId ; }
Get users payment type from last order

@param string $sUserId order user id

@return string $sLastPaymentId payment id
Get users payment type from last order