app/code/community/Adyen/Payment/Model/ProcessNotification.php
public function processResponse($response)
    {
        // SOAP, JSON, HTTP POST
        $storeId = null;

        $this->_debugData['processResponse begin'] = 'Begin to process Notification';

        if (empty($response)) {
            $this->_debugData['error'] = 'Response is empty, please check your webserver that the result url accepts parameters';
            $this->_debug($storeId);
            return array('response' => '401');
        }

        // Log the results in log file and adyen_debug table
        $this->_debugData['response'] = $response;
        Mage::getResourceModel('adyen/adyen_debug')->assignData($response);

//      $params = new Varien_Object($response);
        // Create Varien_Object from response (soap compatible)
        $params = new Varien_Object();
        foreach ($response as $code => $value) {
            $params->setData($code, $value);
        }

        $actionName = $this->_getRequest()->getActionName();

        // authenticate result url
        $authStatus = Mage::getModel('adyen/authenticate')->authenticate($actionName, $params);
        if (!$authStatus['authentication']) {
            $this->_debugData['error'] = 'Autentication failure please check your notification username and password. This must be the same in Magento as in the Adyen platform';
            $this->_debug($storeId);
            return array('response' => '401', 'message' => $authStatus['message']);
        }

        // skip notification if notification is REPORT_AVAILABLE
        $eventCode = trim($params->getData('eventCode'));
        if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REPORT_AVAILABLE) {
            $this->_debugData['processResponse info'] = 'Skip notification REPORT_AVAILABLE';
            $this->_debug($storeId);
            return;
        }

        $this->_declareCommonVariables($params);
        $isInvalidKcp = $this->_isInvalidKcp($this->_paymentMethod, $this->_value);
        if ($isInvalidKcp) {
            $this->_debugData['processResponse info'] = 'Skip notification for KCP and 0 amount';
            $this->_debug($storeId);
            return;
        }

        // check if notification is not duplicate
        if (!$this->_isDuplicate($params)) {
            $incrementId = $params->getData('merchantReference');

            if ($incrementId) {
                $this->_debugData['info'] = 'Add this notification with Order increment_id to queue: ' . $incrementId;
                $this->_addNotificationToQueue($params);
            } else {
                $this->_debugData['error'] = 'Empty merchantReference';
            }
        } else {
            $this->_debugData['processResponse info'] = 'Skipping duplicate notification';
        }

        $this->_debug($storeId);
    }
public function processResponse($response)
    {
        // SOAP, JSON, HTTP POST
        $storeId = null;

        $this->_debugData['processResponse begin'] = 'Begin to process Notification';

        if (empty($response)) {
            $this->_debugData['error'] = 'Response is empty, please check your webserver that the result url accepts parameters';
            $this->_debug($storeId);
            return array('response' => '401');
        }

        // Log the results in log file and adyen_debug table
        $this->_debugData['response'] = $response;
        Mage::getResourceModel('adyen/adyen_debug')->assignData($response);

//      $params = new Varien_Object($response);
        // Create Varien_Object from response (soap compatible)
        $params = new Varien_Object();
        foreach ($response as $code => $value) {
            $params->setData($code, $value);
        }

        $actionName = $this->_getRequest()->getActionName();

        // authenticate result url
        $authStatus = Mage::getModel('adyen/authenticate')->authenticate($actionName, $params);
        if (!$authStatus['authentication']) {
            $this->_debugData['error'] = 'Autentication failure please check your notification username and password. This must be the same in Magento as in the Adyen platform';
            $this->_debug($storeId);
            return array('response' => '401', 'message' => $authStatus['message']);
        }

        // skip notification if notification is REPORT_AVAILABLE
        $eventCode = trim($params->getData('eventCode'));
        if ($eventCode == Adyen_Payment_Model_Event::ADYEN_EVENT_REPORT_AVAILABLE) {
            $this->_debugData['processResponse info'] = 'Skip notification REPORT_AVAILABLE';
            $this->_debug($storeId);
            return;
        }

        $this->_declareCommonVariables($params);
        $isInvalidKcp = $this->_isInvalidKcp($this->_paymentMethod, $this->_value);
        if ($isInvalidKcp) {
            $this->_debugData['processResponse info'] = 'Skip notification for KCP and 0 amount';
            $this->_debug($storeId);
            return;
        }

        // check if notification is not duplicate
        if (!$this->_isDuplicate($params)) {
            $incrementId = $params->getData('merchantReference');

            if ($incrementId) {
                $this->_debugData['info'] = 'Add this notification with Order increment_id to queue: ' . $incrementId;
                $this->_addNotificationToQueue($params);
            } else {
                $this->_debugData['error'] = 'Empty merchantReference';
            }
        } else {
            $this->_debugData['processResponse info'] = 'Skipping duplicate notification';
        }

        $this->_debug($storeId);
    }
public function processResponse ( $ response ) { // SOAP, JSON, HTTP POST $ storeId = null ; $ this -> _debugData [ 'processResponse begin' ] = 'Begin to process Notification' ; if ( empty ( $ response ) ) { $ this -> _debugData [ 'error' ] = 'Response is empty, please check your webserver that the result url accepts parameters' ; $ this -> _debug ( $ storeId ) ; return array ( 'response' => '401' ) ; } // Log the results in log file and adyen_debug table $ this -> _debugData [ 'response' ] = $ response ; Mage :: getResourceModel ( 'adyen/adyen_debug' ) -> assignData ( $ response ) ; //      $params = new Varien_Object($response); // Create Varien_Object from response (soap compatible) $ params = new Varien_Object ( ) ; foreach ( $ response as $ code => $ value ) { $ params -> setData ( $ code , $ value ) ; } $ actionName = $ this -> _getRequest ( ) -> getActionName ( ) ; // authenticate result url $ authStatus = Mage :: getModel ( 'adyen/authenticate' ) -> authenticate ( $ actionName , $ params ) ; if ( ! $ authStatus [ 'authentication' ] ) { $ this -> _debugData [ 'error' ] = 'Autentication failure please check your notification username and password. This must be the same in Magento as in the Adyen platform' ; $ this -> _debug ( $ storeId ) ; return array ( 'response' => '401' , 'message' => $ authStatus [ 'message' ] ) ; } // skip notification if notification is REPORT_AVAILABLE $ eventCode = trim ( $ params -> getData ( 'eventCode' ) ) ; if ( $ eventCode == Adyen_Payment_Model_Event :: ADYEN_EVENT_REPORT_AVAILABLE ) { $ this -> _debugData [ 'processResponse info' ] = 'Skip notification REPORT_AVAILABLE' ; $ this -> _debug ( $ storeId ) ; return ; } $ this -> _declareCommonVariables ( $ params ) ; $ isInvalidKcp = $ this -> _isInvalidKcp ( $ this -> _paymentMethod , $ this -> _value ) ; if ( $ isInvalidKcp ) { $ this -> _debugData [ 'processResponse info' ] = 'Skip notification for KCP and 0 amount' ; $ this -> _debug ( $ storeId ) ; return ; } // check if notification is not duplicate if ( ! $ this -> _isDuplicate ( $ params ) ) { $ incrementId = $ params -> getData ( 'merchantReference' ) ; if ( $ incrementId ) { $ this -> _debugData [ 'info' ] = 'Add this notification with Order increment_id to queue: ' . $ incrementId ; $ this -> _addNotificationToQueue ( $ params ) ; } else { $ this -> _debugData [ 'error' ] = 'Empty merchantReference' ; } } else { $ this -> _debugData [ 'processResponse info' ] = 'Skipping duplicate notification' ; } $ this -> _debug ( $ storeId ) ; }
Process the notification that is received by the Adyen platform
@param $response
@return string
Process the notification that is received by the Adyen platform