Source/SimpleIos.php
public function runIos()
    {
        $this->debugMessage[] = 'IOS: START';
        if ($this->merchantId == "" || $this->orderNumber == 'N/A') {
            $this->errorMessage[] = 'IOS: MISSING DATA';
            $this->debugMessage[] = 'IOS: END';
            return false;
        }
        $iosArray = array(
            'MERCHANT' => $this->merchantId,
            'REFNOEXT' => $this->orderNumber,
            'HASH' => $this->createHashString(array($this->merchantId, $this->orderNumber))
        );
        $this->logFunc("IOS", $iosArray, $this->orderNumber);
        $iosCounter = 0;
        while ($iosCounter < $this->maxRun) {
            $result = $this->startRequest($this->iosOrderUrl, $iosArray, 'POST');
            if ($result === false) {
                $result = '<?xml version="1.0"?>
                <Order>
                    <ORDER_DATE>' . @date("Y-m-d H:i:s", time()) . '</ORDER_DATE>
                    <REFNO>N/A</REFNO>
                    <REFNOEXT>N/A</REFNOEXT>
                    <ORDER_STATUS>EMPTY RESULT</ORDER_STATUS>
                    <PAYMETHOD>N/A</PAYMETHOD>
                    <HASH>N/A</HASH>
                </Order>';
            }

            $resultArray = (array) simplexml_load_string($result);
            foreach ($resultArray as $itemName => $itemValue) {
                $this->status[$itemName] = $itemValue;
            }

            //Validation
            $valid = false;
            if (!isset($this->status['HASH'])) {
                $this->debugMessage[] = 'IOS HASH: MISSING';
            }
            if ($this->createHashString($this->flatArray($this->status, array("HASH"))) == @$this->status['HASH']) {
                $valid = true;
                $this->debugMessage[] = 'IOS HASH: VALID';
            }
            if (!$valid) {
                $iosCounter += $this->maxRun+10;
                $this->debugMessage[] = 'IOS HASH: INVALID';
            }

            //state
            switch ($this->status['ORDER_STATUS']) {
                case 'NOT_FOUND':
                    $iosCounter++;
                    sleep(1);
                    break;
                case 'CARD_NOTAUTHORIZED':
                    $iosCounter += 5;
                    sleep(1);
                    break;
                default:
                    $iosCounter += $this->maxRun;
            }
            $this->debugMessage[] = 'IOS ORDER_STATUS: ' . $this->status['ORDER_STATUS'];
        }
        $this->debugMessage[] = 'IOS: END';
    }
public function runIos()
    {
        $this->debugMessage[] = 'IOS: START';
        if ($this->merchantId == "" || $this->orderNumber == 'N/A') {
            $this->errorMessage[] = 'IOS: MISSING DATA';
            $this->debugMessage[] = 'IOS: END';
            return false;
        }
        $iosArray = array(
            'MERCHANT' => $this->merchantId,
            'REFNOEXT' => $this->orderNumber,
            'HASH' => $this->createHashString(array($this->merchantId, $this->orderNumber))
        );
        $this->logFunc("IOS", $iosArray, $this->orderNumber);
        $iosCounter = 0;
        while ($iosCounter < $this->maxRun) {
            $result = $this->startRequest($this->iosOrderUrl, $iosArray, 'POST');
            if ($result === false) {
                $result = '<?xml version="1.0"?>
                <Order>
                    <ORDER_DATE>' . @date("Y-m-d H:i:s", time()) . '</ORDER_DATE>
                    <REFNO>N/A</REFNO>
                    <REFNOEXT>N/A</REFNOEXT>
                    <ORDER_STATUS>EMPTY RESULT</ORDER_STATUS>
                    <PAYMETHOD>N/A</PAYMETHOD>
                    <HASH>N/A</HASH>
                </Order>';
            }

            $resultArray = (array) simplexml_load_string($result);
            foreach ($resultArray as $itemName => $itemValue) {
                $this->status[$itemName] = $itemValue;
            }

            //Validation
            $valid = false;
            if (!isset($this->status['HASH'])) {
                $this->debugMessage[] = 'IOS HASH: MISSING';
            }
            if ($this->createHashString($this->flatArray($this->status, array("HASH"))) == @$this->status['HASH']) {
                $valid = true;
                $this->debugMessage[] = 'IOS HASH: VALID';
            }
            if (!$valid) {
                $iosCounter += $this->maxRun+10;
                $this->debugMessage[] = 'IOS HASH: INVALID';
            }

            //state
            switch ($this->status['ORDER_STATUS']) {
                case 'NOT_FOUND':
                    $iosCounter++;
                    sleep(1);
                    break;
                case 'CARD_NOTAUTHORIZED':
                    $iosCounter += 5;
                    sleep(1);
                    break;
                default:
                    $iosCounter += $this->maxRun;
            }
            $this->debugMessage[] = 'IOS ORDER_STATUS: ' . $this->status['ORDER_STATUS'];
        }
        $this->debugMessage[] = 'IOS: END';
    }
public function runIos ( ) { $ this -> debugMessage [ ] = 'IOS: START' ; if ( $ this -> merchantId == "" || $ this -> orderNumber == 'N/A' ) { $ this -> errorMessage [ ] = 'IOS: MISSING DATA' ; $ this -> debugMessage [ ] = 'IOS: END' ; return false ; } $ iosArray = array ( 'MERCHANT' => $ this -> merchantId , 'REFNOEXT' => $ this -> orderNumber , 'HASH' => $ this -> createHashString ( array ( $ this -> merchantId , $ this -> orderNumber ) ) ) ; $ this -> logFunc ( "IOS" , $ iosArray , $ this -> orderNumber ) ; $ iosCounter = 0 ; while ( $ iosCounter < $ this -> maxRun ) { $ result = $ this -> startRequest ( $ this -> iosOrderUrl , $ iosArray , 'POST' ) ; if ( $ result === false ) { $ result = '<?xml version="1.0"?>
                <Order>
                    <ORDER_DATE>' . @ date ( "Y-m-d H:i:s" , time ( ) ) . '</ORDER_DATE>
                    <REFNO>N/A</REFNO>
                    <REFNOEXT>N/A</REFNOEXT>
                    <ORDER_STATUS>EMPTY RESULT</ORDER_STATUS>
                    <PAYMETHOD>N/A</PAYMETHOD>
                    <HASH>N/A</HASH>
                </Order>' ; } $ resultArray = ( array ) simplexml_load_string ( $ result ) ; foreach ( $ resultArray as $ itemName => $ itemValue ) { $ this -> status [ $ itemName ] = $ itemValue ; } //Validation $ valid = false ; if ( ! isset ( $ this -> status [ 'HASH' ] ) ) { $ this -> debugMessage [ ] = 'IOS HASH: MISSING' ; } if ( $ this -> createHashString ( $ this -> flatArray ( $ this -> status , array ( "HASH" ) ) ) == @ $ this -> status [ 'HASH' ] ) { $ valid = true ; $ this -> debugMessage [ ] = 'IOS HASH: VALID' ; } if ( ! $ valid ) { $ iosCounter += $ this -> maxRun + 10 ; $ this -> debugMessage [ ] = 'IOS HASH: INVALID' ; } //state switch ( $ this -> status [ 'ORDER_STATUS' ] ) { case 'NOT_FOUND' : $ iosCounter ++ ; sleep ( 1 ) ; break ; case 'CARD_NOTAUTHORIZED' : $ iosCounter += 5 ; sleep ( 1 ) ; break ; default : $ iosCounter += $ this -> maxRun ; } $ this -> debugMessage [ ] = 'IOS ORDER_STATUS: ' . $ this -> status [ 'ORDER_STATUS' ] ; } $ this -> debugMessage [ ] = 'IOS: END' ; }
Starts IOS communication

@return void
Starts IOS communication