ext/bestitamazonpay4oxid_oxorder.php
protected function _performAmazonActions($blAuthorizeAsync)
    {
        $oContainer = $this->_getContainer();
        $oSession = $oContainer->getSession();
        $oConfig = $oContainer->getConfig();

        //Save Amazon reference ID to oxorder table
        $this->_setFieldData('bestitamazonorderreferenceid', $oSession->getVariable('amazonOrderReferenceId'));
        $this->save();
        $oContainer->getClient()->setOrderAttributes($this);

        //If ERP mode is enabled do nothing just set oxorder->oxtransstatus to specified value
        if ((bool)$oConfig->getConfigParam('blAmazonERP') === true) {
            $this->_setFieldData('oxtransstatus', $oConfig->getConfigParam('sAmazonERPModeStatus'));
            $this->save();
            return;
        }

        //If we had Sync mode enabled don't call Authorize once again
        if ($blAuthorizeAsync === false) {
            $sAmazonSyncResponseState = (string)$oSession->getVariable('sAmazonSyncResponseState');
            $sAmazonSyncResponseAuthorizationId = (string)$oSession->getVariable('sAmazonSyncResponseAuthorizationId');

            if ($sAmazonSyncResponseState !== '' && $sAmazonSyncResponseAuthorizationId !== '') {
                $this->assign(array(
                    'bestitamazonauthorizationid' => $sAmazonSyncResponseAuthorizationId,
                    'oxtransstatus' => 'AMZ-Authorize-'.$sAmazonSyncResponseState
                ));
                $this->save();
            }

            //If Capture handling was set to "Direct Capture after Authorize" and Authorization status is Open
            if ((string)$oConfig->getConfigParam('sAmazonCapture') === 'DIRECT'
                && (string)$oSession->getVariable('sAmazonSyncResponseState') === 'Open'
            ) {
                $oContainer->getClient()->capture($this);
            }

            return;
        }

        //Call Amazon authorize (Dedicated for Async mode)
        $oContainer->getClient()->authorize($this);
        return;
    }
protected function _performAmazonActions($blAuthorizeAsync)
    {
        $oContainer = $this->_getContainer();
        $oSession = $oContainer->getSession();
        $oConfig = $oContainer->getConfig();

        //Save Amazon reference ID to oxorder table
        $this->_setFieldData('bestitamazonorderreferenceid', $oSession->getVariable('amazonOrderReferenceId'));
        $this->save();
        $oContainer->getClient()->setOrderAttributes($this);

        //If ERP mode is enabled do nothing just set oxorder->oxtransstatus to specified value
        if ((bool)$oConfig->getConfigParam('blAmazonERP') === true) {
            $this->_setFieldData('oxtransstatus', $oConfig->getConfigParam('sAmazonERPModeStatus'));
            $this->save();
            return;
        }

        //If we had Sync mode enabled don't call Authorize once again
        if ($blAuthorizeAsync === false) {
            $sAmazonSyncResponseState = (string)$oSession->getVariable('sAmazonSyncResponseState');
            $sAmazonSyncResponseAuthorizationId = (string)$oSession->getVariable('sAmazonSyncResponseAuthorizationId');

            if ($sAmazonSyncResponseState !== '' && $sAmazonSyncResponseAuthorizationId !== '') {
                $this->assign(array(
                    'bestitamazonauthorizationid' => $sAmazonSyncResponseAuthorizationId,
                    'oxtransstatus' => 'AMZ-Authorize-'.$sAmazonSyncResponseState
                ));
                $this->save();
            }

            //If Capture handling was set to "Direct Capture after Authorize" and Authorization status is Open
            if ((string)$oConfig->getConfigParam('sAmazonCapture') === 'DIRECT'
                && (string)$oSession->getVariable('sAmazonSyncResponseState') === 'Open'
            ) {
                $oContainer->getClient()->capture($this);
            }

            return;
        }

        //Call Amazon authorize (Dedicated for Async mode)
        $oContainer->getClient()->authorize($this);
        return;
    }
protected function _performAmazonActions ( $ blAuthorizeAsync ) { $ oContainer = $ this -> _getContainer ( ) ; $ oSession = $ oContainer -> getSession ( ) ; $ oConfig = $ oContainer -> getConfig ( ) ; //Save Amazon reference ID to oxorder table $ this -> _setFieldData ( 'bestitamazonorderreferenceid' , $ oSession -> getVariable ( 'amazonOrderReferenceId' ) ) ; $ this -> save ( ) ; $ oContainer -> getClient ( ) -> setOrderAttributes ( $ this ) ; //If ERP mode is enabled do nothing just set oxorder->oxtransstatus to specified value if ( ( bool ) $ oConfig -> getConfigParam ( 'blAmazonERP' ) === true ) { $ this -> _setFieldData ( 'oxtransstatus' , $ oConfig -> getConfigParam ( 'sAmazonERPModeStatus' ) ) ; $ this -> save ( ) ; return ; } //If we had Sync mode enabled don't call Authorize once again if ( $ blAuthorizeAsync === false ) { $ sAmazonSyncResponseState = ( string ) $ oSession -> getVariable ( 'sAmazonSyncResponseState' ) ; $ sAmazonSyncResponseAuthorizationId = ( string ) $ oSession -> getVariable ( 'sAmazonSyncResponseAuthorizationId' ) ; if ( $ sAmazonSyncResponseState !== '' && $ sAmazonSyncResponseAuthorizationId !== '' ) { $ this -> assign ( array ( 'bestitamazonauthorizationid' => $ sAmazonSyncResponseAuthorizationId , 'oxtransstatus' => 'AMZ-Authorize-' . $ sAmazonSyncResponseState ) ) ; $ this -> save ( ) ; } //If Capture handling was set to "Direct Capture after Authorize" and Authorization status is Open if ( ( string ) $ oConfig -> getConfigParam ( 'sAmazonCapture' ) === 'DIRECT' && ( string ) $ oSession -> getVariable ( 'sAmazonSyncResponseState' ) === 'Open' ) { $ oContainer -> getClient ( ) -> capture ( $ this ) ; } return ; } //Call Amazon authorize (Dedicated for Async mode) $ oContainer -> getClient ( ) -> authorize ( $ this ) ; return ; }
Async Authorize call and data update

@param bool $blAuthorizeAsync

@throws Exception
@throws oxSystemComponentException
Async Authorize call and data update