Source/SimpleBackRef.php
protected function checkRtVariable($ios)
    {
        $successCode = array("000", "001");
        if (isset($this->getData['RT'])) {
            $returnCode = substr($this->getData['RT'], 0, 3);

            //000 and 001 are successful
            if (in_array($returnCode, $successCode)) {
                $this->backStatusArray['RESULT'] = true;
                $this->debugMessage[] = 'Return code: ' . $returnCode;
                return true;

                //all other unsuccessful
            } elseif ($this->getData['RT'] != "" && !in_array($returnCode, $successCode)) {
                $this->backStatusArray['RESULT'] = false;
                $this->errorMessage[] = 'Return code: ' . $returnCode;
                return false;

                //in case of WIRE we have no bank return code and return text value, so RT has to be empty
            } elseif ($this->getData['RT'] == "") {
                //check IOS ORDER_STATUS
                if (in_array(trim($ios->status['ORDER_STATUS']), $this->successfulStatus)) {
                    $this->backStatusArray['RESULT'] = true;
                    return true;
                }
                $this->backStatusArray['RESULT'] = false;
                $this->errorMessage[] = 'Empty RT and status is: ' . $ios->status['ORDER_STATUS'];
                return false;
            }
            $this->backStatusArray['RESULT'] = false;
            $this->errorMessage[] = 'RT content: failure!';
            return false;

        } elseif (!isset($this->getData['RT'])) {
            $this->backStatusArray['RESULT'] = false;
            $this->errorMessage[] = 'Missing variable: (RT)!';
            return false;
        }
        $this->backStatusArray['RESULT'] = false;
        $this->errorMessage[] = 'checkRtVariable: general error!';
        return false;
    }
protected function checkRtVariable($ios)
    {
        $successCode = array("000", "001");
        if (isset($this->getData['RT'])) {
            $returnCode = substr($this->getData['RT'], 0, 3);

            //000 and 001 are successful
            if (in_array($returnCode, $successCode)) {
                $this->backStatusArray['RESULT'] = true;
                $this->debugMessage[] = 'Return code: ' . $returnCode;
                return true;

                //all other unsuccessful
            } elseif ($this->getData['RT'] != "" && !in_array($returnCode, $successCode)) {
                $this->backStatusArray['RESULT'] = false;
                $this->errorMessage[] = 'Return code: ' . $returnCode;
                return false;

                //in case of WIRE we have no bank return code and return text value, so RT has to be empty
            } elseif ($this->getData['RT'] == "") {
                //check IOS ORDER_STATUS
                if (in_array(trim($ios->status['ORDER_STATUS']), $this->successfulStatus)) {
                    $this->backStatusArray['RESULT'] = true;
                    return true;
                }
                $this->backStatusArray['RESULT'] = false;
                $this->errorMessage[] = 'Empty RT and status is: ' . $ios->status['ORDER_STATUS'];
                return false;
            }
            $this->backStatusArray['RESULT'] = false;
            $this->errorMessage[] = 'RT content: failure!';
            return false;

        } elseif (!isset($this->getData['RT'])) {
            $this->backStatusArray['RESULT'] = false;
            $this->errorMessage[] = 'Missing variable: (RT)!';
            return false;
        }
        $this->backStatusArray['RESULT'] = false;
        $this->errorMessage[] = 'checkRtVariable: general error!';
        return false;
    }
protected function checkRtVariable ( $ ios ) { $ successCode = array ( "000" , "001" ) ; if ( isset ( $ this -> getData [ 'RT' ] ) ) { $ returnCode = substr ( $ this -> getData [ 'RT' ] , 0 , 3 ) ; //000 and 001 are successful if ( in_array ( $ returnCode , $ successCode ) ) { $ this -> backStatusArray [ 'RESULT' ] = true ; $ this -> debugMessage [ ] = 'Return code: ' . $ returnCode ; return true ; //all other unsuccessful } elseif ( $ this -> getData [ 'RT' ] != "" && ! in_array ( $ returnCode , $ successCode ) ) { $ this -> backStatusArray [ 'RESULT' ] = false ; $ this -> errorMessage [ ] = 'Return code: ' . $ returnCode ; return false ; //in case of WIRE we have no bank return code and return text value, so RT has to be empty } elseif ( $ this -> getData [ 'RT' ] == "" ) { //check IOS ORDER_STATUS if ( in_array ( trim ( $ ios -> status [ 'ORDER_STATUS' ] ) , $ this -> successfulStatus ) ) { $ this -> backStatusArray [ 'RESULT' ] = true ; return true ; } $ this -> backStatusArray [ 'RESULT' ] = false ; $ this -> errorMessage [ ] = 'Empty RT and status is: ' . $ ios -> status [ 'ORDER_STATUS' ] ; return false ; } $ this -> backStatusArray [ 'RESULT' ] = false ; $ this -> errorMessage [ ] = 'RT content: failure!' ; return false ; } elseif ( ! isset ( $ this -> getData [ 'RT' ] ) ) { $ this -> backStatusArray [ 'RESULT' ] = false ; $ this -> errorMessage [ ] = 'Missing variable: (RT)!' ; return false ; } $ this -> backStatusArray [ 'RESULT' ] = false ; $ this -> errorMessage [ ] = 'checkRtVariable: general error!' ; return false ; }
Check RT variable

@param obj $ios Result of IOS comunication

@return boolean
Check RT variable