public function getIBPTProd($cnpj = '', $tokenIBPT = '', $ncm = '', $siglaUF = '', $exTarif = '0')
{
$url = "http://iws.ibpt.org.br/api/Produtos?token={$tokenIBPT}&cnpj={$cnpj}&codigo={$ncm}&uf={$siglaUF}&ex={$exTarif}";
$resposta = $this->zCommCurl($url, '', array(), 80);
$retorno = str_replace("\r\n", "|", $resposta);
$aResp = explode("||", $retorno);
if (!empty($aResp[1])) {
if (substr($aResp[1], 0, 1) == '{') {
$json = $aResp[1];
return (array) json_decode($json, true);
}
}
return array();
}