src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerSofortueberweisung.class.php
protected function NotifyPayloadIsValid($aParameter)
    {
        $bIsValid = true;

        $aMessage = array('msg' => '', 'line' => 0);
        // validate hash
        $sCalculatedHash = $this->BuildIncomingHash($aParameter);
        $sHash = (array_key_exists('hash', $aParameter)) ? $aParameter['hash'] : '';
        if (0 != strcmp($sHash, $sCalculatedHash)) {
            $aMessage = array('msg' => "sofortueberweisung-notify: calculated hash [{$sCalculatedHash}] does not match hash passed [{$sHash}] for order", 'line' => __LINE__);
            $bIsValid = false;
        }

        /** @var $oOrder TdbShopOrder */
        $oOrder = null;
        if ($bIsValid) {
            // order id exists?
            $sOrderId = (array_key_exists('user_variable_3', $aParameter)) ? $aParameter['user_variable_3'] : '';
            $oOrder = TdbShopOrder::GetNewInstance();
            if (false == $oOrder->Load($sOrderId)) {
                $aMessage = array('msg' => "sofortueberweisung-notify: order id passed [{$sOrderId}] was not found in database: ", 'line' => __LINE__);
                $bIsValid = false;
            }
        }

        if ($bIsValid) {
            // order amount matches?
            $dOrderAmount = (array_key_exists('amount', $aParameter)) ? $aParameter['amount'] : '';
            if (0 != strcmp($dOrderAmount, $oOrder->fieldValueTotal)) {
                $aMessage = array('msg' => "sofortueberweisung-notify: amount paid [{$dOrderAmount}] for order [{$oOrder->id}] does not match order value [{$oOrder->fieldValueTotal}]: ", 'line' => __LINE__);
                $bIsValid = false;
            }
        }

        if (false == $bIsValid) {
            TTools::WriteLogEntry($aMessage['msg'].' DATA: '.print_r($aParameter, true), 1, __FILE__, $aMessage['line']);
            $bIsValid = $aMessage['msg'];
        }

        return $bIsValid;
    }
protected function NotifyPayloadIsValid($aParameter)
    {
        $bIsValid = true;

        $aMessage = array('msg' => '', 'line' => 0);
        // validate hash
        $sCalculatedHash = $this->BuildIncomingHash($aParameter);
        $sHash = (array_key_exists('hash', $aParameter)) ? $aParameter['hash'] : '';
        if (0 != strcmp($sHash, $sCalculatedHash)) {
            $aMessage = array('msg' => "sofortueberweisung-notify: calculated hash [{$sCalculatedHash}] does not match hash passed [{$sHash}] for order", 'line' => __LINE__);
            $bIsValid = false;
        }

        /** @var $oOrder TdbShopOrder */
        $oOrder = null;
        if ($bIsValid) {
            // order id exists?
            $sOrderId = (array_key_exists('user_variable_3', $aParameter)) ? $aParameter['user_variable_3'] : '';
            $oOrder = TdbShopOrder::GetNewInstance();
            if (false == $oOrder->Load($sOrderId)) {
                $aMessage = array('msg' => "sofortueberweisung-notify: order id passed [{$sOrderId}] was not found in database: ", 'line' => __LINE__);
                $bIsValid = false;
            }
        }

        if ($bIsValid) {
            // order amount matches?
            $dOrderAmount = (array_key_exists('amount', $aParameter)) ? $aParameter['amount'] : '';
            if (0 != strcmp($dOrderAmount, $oOrder->fieldValueTotal)) {
                $aMessage = array('msg' => "sofortueberweisung-notify: amount paid [{$dOrderAmount}] for order [{$oOrder->id}] does not match order value [{$oOrder->fieldValueTotal}]: ", 'line' => __LINE__);
                $bIsValid = false;
            }
        }

        if (false == $bIsValid) {
            TTools::WriteLogEntry($aMessage['msg'].' DATA: '.print_r($aParameter, true), 1, __FILE__, $aMessage['line']);
            $bIsValid = $aMessage['msg'];
        }

        return $bIsValid;
    }
protected function NotifyPayloadIsValid ( $ aParameter ) { $ bIsValid = true ; $ aMessage = array ( 'msg' => '' , 'line' => 0 ) ; // validate hash $ sCalculatedHash = $ this -> BuildIncomingHash ( $ aParameter ) ; $ sHash = ( array_key_exists ( 'hash' , $ aParameter ) ) ? $ aParameter [ 'hash' ] : '' ; if ( 0 != strcmp ( $ sHash , $ sCalculatedHash ) ) { $ aMessage = array ( 'msg' => "sofortueberweisung-notify: calculated hash [{$sCalculatedHash}] does not match hash passed [{$sHash}] for order" , 'line' => __LINE__ ) ; $ bIsValid = false ; } /** @var $oOrder TdbShopOrder */ $ oOrder = null ; if ( $ bIsValid ) { // order id exists? $ sOrderId = ( array_key_exists ( 'user_variable_3' , $ aParameter ) ) ? $ aParameter [ 'user_variable_3' ] : '' ; $ oOrder = TdbShopOrder :: GetNewInstance ( ) ; if ( false == $ oOrder -> Load ( $ sOrderId ) ) { $ aMessage = array ( 'msg' => "sofortueberweisung-notify: order id passed [{$sOrderId}] was not found in database: " , 'line' => __LINE__ ) ; $ bIsValid = false ; } } if ( $ bIsValid ) { // order amount matches? $ dOrderAmount = ( array_key_exists ( 'amount' , $ aParameter ) ) ? $ aParameter [ 'amount' ] : '' ; if ( 0 != strcmp ( $ dOrderAmount , $ oOrder -> fieldValueTotal ) ) { $ aMessage = array ( 'msg' => "sofortueberweisung-notify: amount paid [{$dOrderAmount}] for order [{$oOrder->id}] does not match order value [{$oOrder->fieldValueTotal}]: " , 'line' => __LINE__ ) ; $ bIsValid = false ; } } if ( false == $ bIsValid ) { TTools :: WriteLogEntry ( $ aMessage [ 'msg' ] . ' DATA: ' . print_r ( $ aParameter , true ) , 1 , __FILE__ , $ aMessage [ 'line' ] ) ; $ bIsValid = $ aMessage [ 'msg' ] ; } return $ bIsValid ; }
validate input. return true if valid, or error string on error.

@param array $aParameter

@return bool
validate input . return true if valid or error string on error .