src/icepay_api_basic.php
protected function postRequest($url, $data) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $response = curl_exec($ch);
        curl_close($ch);

        if (!$response)
            throw new Exception("Error reading $url");

        if (( substr(strtolower($response), 0, 7) == "http://" ) || ( substr(strtolower($response), 0, 8) == "https://" )) {
            return $response;
        }
        else
            throw new Exception("Server response: " . strip_tags($response));
    }
protected function postRequest($url, $data) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $response = curl_exec($ch);
        curl_close($ch);

        if (!$response)
            throw new Exception("Error reading $url");

        if (( substr(strtolower($response), 0, 7) == "http://" ) || ( substr(strtolower($response), 0, 8) == "https://" )) {
            return $response;
        }
        else
            throw new Exception("Server response: " . strip_tags($response));
    }
protected function postRequest ( $ url , $ data ) { $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 0 ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ data ) ; $ response = curl_exec ( $ ch ) ; curl_close ( $ ch ) ; if ( ! $ response ) throw new Exception ( "Error reading $url" ) ; if ( ( substr ( strtolower ( $ response ) , 0 , 7 ) == "http://" ) || ( substr ( strtolower ( $ response ) , 0 , 8 ) == "https://" ) ) { return $ response ; } else throw new Exception ( "Server response: " . strip_tags ( $ response ) ) ; }
Used to connect to the ICEPAY servers
@since version 1.0.0
@access protected
@param string $url
@param array $data
@return string Returns a response from the specified URL
Used to connect to the ICEPAY servers