function timbrado_cfdi($xml_cfdi) { $datospac = consulta_abierta("usuario_pac, password_pac", "tbempresa", 2, "id", "=", 1, "", null, null, "", null, null, "", null, null, "", null, null, "", null, null, "", null, null, "", null, null, "", null, null, "", null, null, 0, null, 0, null, 0, null); $webservice_pac = "http://pruebas.comercio-digital.mx/timbre/v2/timbrar.aspx?rfc=".$datospac[1][1]."&pwd=".$datospac[1][2]; $ch = curl_init($webservice_pac); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_cfdi); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); $response = curl_exec($ch); $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); $http_message = mensaje($http_status); curl_close($ch); $respuesta = str_replace("", $response."", $xml_cfdi); return array($http_status, $http_message, $respuesta); }