src/PaymentGateway.php
private function __validateUrl($url)
    {
        if (empty($url) || !is_string($url) || strlen($url) > 512 ||
            !preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)+(:[0-9]+)?(\/.*)?$/i', $url) ||
            !filter_var($url, FILTER_VALIDATE_URL)
        ) {
            $this->error = 'invalid url format';
            return false;
        }
        return true;
    }
private function __validateUrl($url)
    {
        if (empty($url) || !is_string($url) || strlen($url) > 512 ||
            !preg_match('/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)+(:[0-9]+)?(\/.*)?$/i', $url) ||
            !filter_var($url, FILTER_VALIDATE_URL)
        ) {
            $this->error = 'invalid url format';
            return false;
        }
        return true;
    }
private function __validateUrl ( $ url ) { if ( empty ( $ url ) || ! is_string ( $ url ) || strlen ( $ url ) > 512 || ! preg_match ( '/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)+(:[0-9]+)?(\/.*)?$/i' , $ url ) || ! filter_var ( $ url , FILTER_VALIDATE_URL ) ) { $ this -> error = 'invalid url format' ; return false ; } return true ; }
Validate url
If url is invalid throw the exception

@param $url
@return bool
Validate url If url is invalid throw the exception