src/ShopBundle/objects/db/TShopPaymentHandler/TShopPaymentHandlerIPaymentEndPoint.class.php
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oGlobal = TGlobal::instance();
            $sStatus = $oGlobal->GetUserData('ret_status');
            if ('ERROR' == $sStatus) {
                $this->SetErrorCodesFromResponseToMessageManager();
                $bPaymentTransmitOk = false;
            }
            $this->sStorageId = $oGlobal->GetUserData('storage_id');
            $this->aPaymentUserData = $oGlobal->GetUserData();
            // the data from ipayment is not returned as iso-8859
            foreach (array_keys($this->aPaymentUserData) as $sKey) {
                if (!is_array($this->aPaymentUserData[$sKey])) {
                    $this->aPaymentUserData[$sKey] = utf8_encode($this->aPaymentUserData[$sKey]);
                }
            }
            $this->aPaymentUserData['sStorageId'] = $this->sStorageId;
        }

        if (true === $bPaymentTransmitOk) {
            $aSecuritiyCheckPostParameter = $this->GetNeedeResponsePostParameterForSecurityCheck();
            $bPaymentTransmitOk = $this->IsSecurityCheckOk($aSecuritiyCheckPostParameter['trxuser_id'], $aSecuritiyCheckPostParameter['trx_amount'], $aSecuritiyCheckPostParameter['trx_currency'], $aSecuritiyCheckPostParameter['ret_authcode'], $aSecuritiyCheckPostParameter['ret_trx_number'], $aSecuritiyCheckPostParameter['ret_param_checksum']);
            if (false === $bPaymentTransmitOk) {
                // security error - unable to validate hash
                TTools::WriteLogEntry('iPayment Error: unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration', 1, __FILE__, __LINE__);
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(TShopPaymentHandlerIPaymentCreditCard::MSG_MANAGER_NAME, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => 'unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration'));
            }
        }

        return $bPaymentTransmitOk;
    }
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oGlobal = TGlobal::instance();
            $sStatus = $oGlobal->GetUserData('ret_status');
            if ('ERROR' == $sStatus) {
                $this->SetErrorCodesFromResponseToMessageManager();
                $bPaymentTransmitOk = false;
            }
            $this->sStorageId = $oGlobal->GetUserData('storage_id');
            $this->aPaymentUserData = $oGlobal->GetUserData();
            // the data from ipayment is not returned as iso-8859
            foreach (array_keys($this->aPaymentUserData) as $sKey) {
                if (!is_array($this->aPaymentUserData[$sKey])) {
                    $this->aPaymentUserData[$sKey] = utf8_encode($this->aPaymentUserData[$sKey]);
                }
            }
            $this->aPaymentUserData['sStorageId'] = $this->sStorageId;
        }

        if (true === $bPaymentTransmitOk) {
            $aSecuritiyCheckPostParameter = $this->GetNeedeResponsePostParameterForSecurityCheck();
            $bPaymentTransmitOk = $this->IsSecurityCheckOk($aSecuritiyCheckPostParameter['trxuser_id'], $aSecuritiyCheckPostParameter['trx_amount'], $aSecuritiyCheckPostParameter['trx_currency'], $aSecuritiyCheckPostParameter['ret_authcode'], $aSecuritiyCheckPostParameter['ret_trx_number'], $aSecuritiyCheckPostParameter['ret_param_checksum']);
            if (false === $bPaymentTransmitOk) {
                // security error - unable to validate hash
                TTools::WriteLogEntry('iPayment Error: unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration', 1, __FILE__, __LINE__);
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(TShopPaymentHandlerIPaymentCreditCard::MSG_MANAGER_NAME, 'ERROR-ORDER-REQUEST-PAYMENT-ERROR', array('errorMsg' => 'unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration'));
            }
        }

        return $bPaymentTransmitOk;
    }
public function PostProcessExternalPaymentHandlerHook ( ) { $ bPaymentTransmitOk = parent :: PostProcessExternalPaymentHandlerHook ( ) ; if ( $ bPaymentTransmitOk ) { $ oGlobal = TGlobal :: instance ( ) ; $ sStatus = $ oGlobal -> GetUserData ( 'ret_status' ) ; if ( 'ERROR' == $ sStatus ) { $ this -> SetErrorCodesFromResponseToMessageManager ( ) ; $ bPaymentTransmitOk = false ; } $ this -> sStorageId = $ oGlobal -> GetUserData ( 'storage_id' ) ; $ this -> aPaymentUserData = $ oGlobal -> GetUserData ( ) ; // the data from ipayment is not returned as iso-8859 foreach ( array_keys ( $ this -> aPaymentUserData ) as $ sKey ) { if ( ! is_array ( $ this -> aPaymentUserData [ $ sKey ] ) ) { $ this -> aPaymentUserData [ $ sKey ] = utf8_encode ( $ this -> aPaymentUserData [ $ sKey ] ) ; } } $ this -> aPaymentUserData [ 'sStorageId' ] = $ this -> sStorageId ; } if ( true === $ bPaymentTransmitOk ) { $ aSecuritiyCheckPostParameter = $ this -> GetNeedeResponsePostParameterForSecurityCheck ( ) ; $ bPaymentTransmitOk = $ this -> IsSecurityCheckOk ( $ aSecuritiyCheckPostParameter [ 'trxuser_id' ] , $ aSecuritiyCheckPostParameter [ 'trx_amount' ] , $ aSecuritiyCheckPostParameter [ 'trx_currency' ] , $ aSecuritiyCheckPostParameter [ 'ret_authcode' ] , $ aSecuritiyCheckPostParameter [ 'ret_trx_number' ] , $ aSecuritiyCheckPostParameter [ 'ret_param_checksum' ] ) ; if ( false === $ bPaymentTransmitOk ) { // security error - unable to validate hash TTools :: WriteLogEntry ( 'iPayment Error: unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration' , 1 , __FILE__ , __LINE__ ) ; $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; $ oMsgManager -> AddMessage ( TShopPaymentHandlerIPaymentCreditCard :: MSG_MANAGER_NAME , 'ERROR-ORDER-REQUEST-PAYMENT-ERROR' , array ( 'errorMsg' => 'unable to validate security hash. Either the Request is manipulated, or the "Transaktions-Security-Key" was not set in the ipayment configuration' ) ) ; } } return $ bPaymentTransmitOk ; }
Save storage id sent from IPayment and make security check
the method is called when an external payment handler returns successfully.
Save storage id sent from IPayment and make security check the method is called when an external payment handler returns successfully .