ext/bestitamazonpay4oxid_oxdeliverysetlist.php
protected function _processResult($aResult, $oUser, $oBasket)
    {
        $oConfig = $this->_getContainer()->getConfig();
        $sClass = $oConfig->getRequestParameter('cl');
        $sAmazonOrderReferenceId = $this->_getContainer()->getSession()->getVariable('amazonOrderReferenceId');

        //If Amazon Pay cannot be selected remove it from payments list
        if ($sClass === 'payment') {
            if ($this->_getContainer()->getModule()->isActive() !== true) {
                unset($aResult[2]['bestitamazon']);
                return $aResult;
            }

            //If Amazon pay was selected with the button before leave only bestitamazon as payment selection
            if ($oUser !== false
                && isset($aResult[2]['bestitamazon'])
                && $sAmazonOrderReferenceId !== null
            ) {
                //If Amazon pay was selected remove other payment options and leave only Amazon pay
                $aResult[2] = array('bestitamazon' => $aResult[2]['bestitamazon']);

                //If Amazon pay was selected remove shipping options where Amazon pay is not assigned
                foreach ($aResult[0] as $sKey => $sValue) {
                    if ($this->_getShippingAvailableForPayment($sKey) !== true) {
                        unset($aResult[0][$sKey]);
                    }
                }
            }
        }

        //If Amazon pay was not selected within the button click in 1st, 2nd step of checkout
        //check if selected currency is available for selected Amazon locale, if not remove amazon pay option from payments
        if ($sAmazonOrderReferenceId === null
            && ($this->_getContainer()->getModule()->getIsSelectedCurrencyAvailable() === false
                || $oBasket->getPrice()->getBruttoPrice() === 0
                || ((bool)$oConfig->getConfigParam('blAmazonLoginActive') === true
                    && $this->_getContainer()->getLoginClient()->showAmazonPayButton() === false)
            )
        ) {
            unset($aResult[2]['bestitamazon']);
        }

        return $aResult;
    }
protected function _processResult($aResult, $oUser, $oBasket)
    {
        $oConfig = $this->_getContainer()->getConfig();
        $sClass = $oConfig->getRequestParameter('cl');
        $sAmazonOrderReferenceId = $this->_getContainer()->getSession()->getVariable('amazonOrderReferenceId');

        //If Amazon Pay cannot be selected remove it from payments list
        if ($sClass === 'payment') {
            if ($this->_getContainer()->getModule()->isActive() !== true) {
                unset($aResult[2]['bestitamazon']);
                return $aResult;
            }

            //If Amazon pay was selected with the button before leave only bestitamazon as payment selection
            if ($oUser !== false
                && isset($aResult[2]['bestitamazon'])
                && $sAmazonOrderReferenceId !== null
            ) {
                //If Amazon pay was selected remove other payment options and leave only Amazon pay
                $aResult[2] = array('bestitamazon' => $aResult[2]['bestitamazon']);

                //If Amazon pay was selected remove shipping options where Amazon pay is not assigned
                foreach ($aResult[0] as $sKey => $sValue) {
                    if ($this->_getShippingAvailableForPayment($sKey) !== true) {
                        unset($aResult[0][$sKey]);
                    }
                }
            }
        }

        //If Amazon pay was not selected within the button click in 1st, 2nd step of checkout
        //check if selected currency is available for selected Amazon locale, if not remove amazon pay option from payments
        if ($sAmazonOrderReferenceId === null
            && ($this->_getContainer()->getModule()->getIsSelectedCurrencyAvailable() === false
                || $oBasket->getPrice()->getBruttoPrice() === 0
                || ((bool)$oConfig->getConfigParam('blAmazonLoginActive') === true
                    && $this->_getContainer()->getLoginClient()->showAmazonPayButton() === false)
            )
        ) {
            unset($aResult[2]['bestitamazon']);
        }

        return $aResult;
    }
protected function _processResult ( $ aResult , $ oUser , $ oBasket ) { $ oConfig = $ this -> _getContainer ( ) -> getConfig ( ) ; $ sClass = $ oConfig -> getRequestParameter ( 'cl' ) ; $ sAmazonOrderReferenceId = $ this -> _getContainer ( ) -> getSession ( ) -> getVariable ( 'amazonOrderReferenceId' ) ; //If Amazon Pay cannot be selected remove it from payments list if ( $ sClass === 'payment' ) { if ( $ this -> _getContainer ( ) -> getModule ( ) -> isActive ( ) !== true ) { unset ( $ aResult [ 2 ] [ 'bestitamazon' ] ) ; return $ aResult ; } //If Amazon pay was selected with the button before leave only bestitamazon as payment selection if ( $ oUser !== false && isset ( $ aResult [ 2 ] [ 'bestitamazon' ] ) && $ sAmazonOrderReferenceId !== null ) { //If Amazon pay was selected remove other payment options and leave only Amazon pay $ aResult [ 2 ] = array ( 'bestitamazon' => $ aResult [ 2 ] [ 'bestitamazon' ] ) ; //If Amazon pay was selected remove shipping options where Amazon pay is not assigned foreach ( $ aResult [ 0 ] as $ sKey => $ sValue ) { if ( $ this -> _getShippingAvailableForPayment ( $ sKey ) !== true ) { unset ( $ aResult [ 0 ] [ $ sKey ] ) ; } } } } //If Amazon pay was not selected within the button click in 1st, 2nd step of checkout //check if selected currency is available for selected Amazon locale, if not remove amazon pay option from payments if ( $ sAmazonOrderReferenceId === null && ( $ this -> _getContainer ( ) -> getModule ( ) -> getIsSelectedCurrencyAvailable ( ) === false || $ oBasket -> getPrice ( ) -> getBruttoPrice ( ) === 0 || ( ( bool ) $ oConfig -> getConfigParam ( 'blAmazonLoginActive' ) === true && $ this -> _getContainer ( ) -> getLoginClient ( ) -> showAmazonPayButton ( ) === false ) ) ) { unset ( $ aResult [ 2 ] [ 'bestitamazon' ] ) ; } return $ aResult ; }
If Amazon pay was selected remove other payment options and leave only Amazon pay
If Amazon pay was selected remove shipping options where amazon pay is not assigned

Loads deliveryset data, checks if it has payments assigned. If active delivery set id
is passed - checks if it can be used, if not - takes first ship set id from list which
fits. For active ship set collects payment list info. Retuns array containing:
1. all ship sets that has payment (array)
2. active ship set id (string)
3. payment list for active ship set (array)

@param array    $aResult
@param oxUser   $oUser
@param oxBasket $oBasket

@return mixed
@throws oxConnectionException
@throws oxSystemComponentException
If Amazon pay was selected remove other payment options and leave only Amazon pay If Amazon pay was selected remove shipping options where amazon pay is not assigned