Note: this may not be backward compatible given the way $domain was specified, but it does follow the Google spec located here........
public function getUrl($issuer, $user, $secret, $width = 200, $height = 200) {
$url = sprintf("otpauth://totp/%s:%s?secret=%s&issuer=%s", rawurlencode($issuer), $user, $secret, rawurlencode($issuer));
$encoder = sprintf("https://www.google.com/chart?chs=%dx%d&chld=M|0&cht=qr&chl=",$width,$height);
$encoderURL = sprintf( "%s%s",$encoder, rawurlencode($url));
return $encoderURL;
}