9.957 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:00.251 [info] [fetchCompletions] Request f71a8dff-204d-4f55-b7bb-d3954203b6cf at finished with 200 status after 321.98483800003305ms 2025-12-01 15:03:00.349 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:00.442 [info] [fetchCompletions] Request cba7f53d-e358-4e9b-b753-9f7c5de29f9b at finished with 200 status after 196.48632299993187ms 2025-12-01 15:03:00.513 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:00.953 [info] [fetchCompletions] Request cc485b4e-5e7d-4a56-8f28-2b6864c5a292 at finished with 200 status after 176.2327950000763ms 2025-12-01 15:03:01.027 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:01.938 [info] [code-referencing] Calling twirp/github.snippy.v1.SnippyAPI/Match 2025-12-01 15:03:02.034 [info] [code-referencing] No match found 2025-12-01 15:03:15.124 [info] [fetchCompletions] Request 6274b93f-50ae-4c3b-822a-d7ce53fae7fb at finished with 200 status after 162.25267399987206ms 2025-12-01 15:03:15.187 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:15.524 [info] [fetchCompletions] Request 81a64ed9-bf7b-4bc2-9e57-ffe1f537595e at finished with 200 status after 259.58806700026616ms 2025-12-01 15:03:15.526 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:15.910 [info] [fetchCompletions] Request f8e0f2ff-36f2-43de-bfe6-5e0dfd894be1 at finished with 200 status after 167.92343399999663ms 2025-12-01 15:03:16.053 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:03:16.274 [info] [fetchCompletions] Request 6b5e5e42-a28e-4a33-87f2-8be94ded035e at finished with 200 status after 141.4180439999327ms 2025-12-01 15:03:16.358 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:11:31.333 [info] [fetchCompletions] Request 38c33850-56d9-4f85-adb1-d52b91fe3d7c at finished with 200 status after 366.89940900029615ms 2025-12-01 15:11:31.411 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 15:11:31.708 [info] [fetchCompletions] Request 64bce248-d202-4946-900f-8109930fc1e0 at finished with 200 status after 218.53875300008804ms 2025-12-01 15:11:31.809 [info] [streamChoices] solution 0 returned. finish reason: [stop] 2025-12-01 16:01:55.164 [info] Logged in as CarlosAlmendarez 2025-12-01 16:01:55.525 [info] Got Copilot token for CarlosAlmendarez 2025-12-01 16:01:55.525 [info] Copilot Chat: 0.33.3, VS Code: 1.106.3 2025-12-01 16:01:55.931 [info] copilot token chat_enabled: true, sku: free_limited_copilot 2025-12-01 16:01:55.931 [info] [code-referencing] Public code references are enabled. 2025-12-01 16:01:56.124 [info] Fetched model metadata in 193ms cd79f1f5-41de-491d-958a-9e8098fe0cf3 2025-12-01 16:01:56.138 [info] ccreq:7a16bd97.copilotmd | markdown 2025-12-01 16:24:22.273 [info] [fetchCompletions] Request 0437bcfc-56df-4f5e-9762-83f75e8b5699 at finished with 200 status after 328.3157919999212ms 2025-12-01 16:24:22.722 [info] [fetchCompletions] Request cf108b4f-0826-4b44-b63e-be53b24cec4b at "300", "message" => "ERROR - [wsInvoiceSF] Parametros incompletos para el Servicio Web, faltan el Propoietario de la Aplicación"); $Resultado = json_encode($j_array); echo $Resultado; return; } if($bRecId == "") { $j_array = array('code' => "300", "message" => "ERROR - [wsCancelAsyncInvoiceSFJ_v33] Parametros incompletos para el Servicio Web, faltan el ID del CFDI a actualizar"); $Resultado = json_encode($j_array); echo $Resultado; return; } if($bDatPAC == "") { $j_array = array('code' => "300", "message" => "ERROR - [wsCancelAsyncInvoiceSFJ_v33] Parametros incompletos para el Servicio Web, faltan los Datos del PAC"); $Resultado = json_encode($j_array); echo $Resultado; return; } ### 0. EXTRACCION DE PARAMETROS PARA EL CFDI ###################################################### #== Primero, extraemos el JSON del string en base 64 $bdDatPAC = base64_decode($bDatPAC); #== Segundo, decodificamos el JSON a un arreglo $abdDatPAC = json_decode($bdDatPAC,true); $dirBase = realpath("../"); # Configuración de zona horaria date_default_timezone_set('America/Mexico_City'); // ### DEFINICIÓN DE CONSTANTES ################################################### $SendaPEMS = "archs_pem/"; $SendaCFDI = "archs_cfdi/"; // Datos de acceso del usuario (proporcionados por el PAC). if($abdDatPAC["tipoTim"] == 1){ ## Timbrado en producción $urlPAC = "https://solucionfactible.com/ws/services/Cancelacion?wsdl"; } else { ## Timbrado en pruebas $urlPAC = "https://testing.solucionfactible.com/ws/services/Cancelacion?wsdl"; } // Datos para la configuracion del SOAP y los resultados. $username = $abdDatPAC["username"]; $password = $abdDatPAC["password"]; $bdUUID = $abdDatPAC["UUID"]; $fact_serie = $abdDatPAC["serie"]; $fact_folio = $abdDatPAC["folio"]; $invoiceNumber = $abdDatPAC["invoice"]; $invoiceID = $abdDatPAC["invoiceID"]; $RfcEmisor = $abdDatPAC["RfcEmi"]; // Datos "constantes" para los archivos CER y KEY del cliente $noCertificado = $abdDatPAC["Certificado_SAT"]; $file_cer = $abdDatPAC["Archivo_CER"]; $file_key = $abdDatPAC["Archivo_KEY"]; $clavePrivada = $abdDatPAC["Clave_Privada"]; $organi_id_ZB = $abdDatPAC["organization_id_ZB"]; $authtoken_ZB = $abdDatPAC["authtoken_ZB"]; $authtoken_ZC = $abdDatPAC["authtoken_ZC"]; // Leemos el archivo CER del cliente $nombre_fichero = $SendaPEMS.$file_cer; $gestor = fopen($nombre_fichero, "r"); $cerFile = fread($gestor, filesize($nombre_fichero)); fclose($gestor); // Leemos el archivo KEY del cliente $nombre_fichero = $SendaPEMS.$file_key; $gestor = fopen($nombre_fichero, "r"); $keyFile = fread($gestor, filesize($nombre_fichero)); fclose($gestor); // Conversion de los archivos CER y KEY leidos a formato Base64 $bCertB64 = base64_encode($cerFile); $bKeyB64 = base64_encode($keyFile); /* echo "Tipo Timbrado: ".$abdDatPAC["tipoTim"]; echo "
"; echo "username: ".$username; echo "
"; echo "password: ".$password; echo "
"; echo "bdUUID: ".$bdUUID; echo "
"; echo "Motivo: ".$motCancela; echo "
"; echo "UUID Sust: ".$uuidSustit; echo "
"; echo "fact_serie: ".$fact_serie; echo "
"; echo "fact_folio: ".$fact_folio; echo "
"; echo "invoiceNumber: ".$invoiceNumber; echo "
"; echo "invoiceID: ".$invoiceID; echo "
"; echo "RfcEmisor: ".$RfcEmisor; echo "
"; echo "urlPAC: ".$urlPAC; echo "
"; echo "file_cer: ".$SendaPEMS.$file_cer; echo "
"; echo "bCertB64: ".$bCertB64; echo "
"; echo "file_key: ".$SendaPEMS.$file_key; echo "
"; echo "bKeyB64: ".$bKeyB64; echo "
"; echo "
"; */ ### PROCESO DE CACELACION ######################################################## $response = ''; // Datos para la localización del WebService para resolución del WSDL. if($abdDatPAC["tipoTim"] == 1){ ## Timbrado en producción $urlLocation = 'https://solucionfactible.com/ws/services/Cancelacion'; } else { ## Timbrado en pruebas $urlLocation = 'https://testing.solucionfactible.com/ws/services/Cancelacion'; } // $noCertificado = "00001000000719969028"; // $file_cer = "00001000000719969028.cer.pem"; // $file_key = "00001000000719969028.key.pem"; // $clavePrivada = "RZRSELLO25"; #== Se lleva a cabo cancelacion del CFDI ============================ try { $client = new SoapClient($urlPAC); $client->__setLocation($urlLocation); //JFA: Cambio por SF para enviar el motivo de cancelacion $params = array('usuario' => $username, 'password' => $password, 'uuid' => $bdUUID . $motCancela . $uuidSustit, 'rfcEmisor' => $RfcEmisor, 'emailNotifica' => "", 'derCertCSDBase64' => $bCertB64, 'derKeyCSDBase64' => $bKeyB64, 'contrasenaCSD' => $clavePrivada, 'properties' => ""); $response = $client->__soapCall('cancelarAsincrono', array('parameters' => $params)); } catch (SoapFault $fault) { $j_array = array('code' => "900", "message" => "Error al ejecutar el WebService del PAC (SOAP)", 'status' => $fault->faultcode,'mensaje' => $fault->faultstring ); //$j_array = array('code' => "900", "message" => $fault->faultcode."-".$fault->faultstring); $Resultado = json_encode($j_array); echo $Resultado; return; } /* print_r($response); echo "
"; echo "
"; */ $ret = $response->return; if($ret->status != 200) { $sErrMsg = $ret->mensaje; /* switch ($ret->status) { case 204: $sErrMsg = "El comprobante no se puede cancelar"; case 211: $sErrMsg = "La cancelación está en proceso"; case 213: $sErrMsg = "La solicitud de cancelación fue rechazada por el receptor"; case 303: $sErrMsg = "El certificado CSD no corresponde al RFC del contribuyente."; case 305: $sErrMsg = "La fecha de cancelación no está dentro del la vigencia del CSD del emisor."; case 306: $sErrMsg = "Las llaves utilizadas para sellar no corresponden a un CSD."; case 308: $sErrMsg = "El certificado CSD no fue emitido por la Autoridad de SAT."; case 402: $sErrMsg = "El RFC del contribuyente no existe conforme al régimen autorizado LCO."; case 500: $sErrMsg = "Han ocurrido errores internos que han impedido que se registre la solicitud de cancelación, reintentar."; case 501: $sErrMsg = "Ha ocurrido un error interno de comunicación con la base de datos, reintentar."; case 601: $sErrMsg = "Error de autenticación, el nombre de usuario o contraseña son incorrectos."; case 602: $sErrMsg = "La cuenta de usuario se encuentra bloqueada."; case 603: $sErrMsg = "La contraseña de la cuenta ha expirado."; case 604: $sErrMsg = "Se ha superado el número máximo permitido de intentos fallidos de autenticación."; case 605: $sErrMsg = "El usuario se encuentra inactivo."; case 611: $sErrMsg = "Los datos recibidos están incompletos o no se encuentran donde se esperarían."; case 620: $sErrMsg = "Permiso denegado."; case 621: $sErrMsg = "Los datos recibidos no son válidos."; case 633: $sErrMsg = "Uso indebido de cuenta de producción en pruebas o cuenta de prueba en producción."; case 701: $sErrMsg = "Ya existe una transacción asíncrona para el UUID especificado."; } */ $j_array = array('code' => "901", "message" => "Se presento un problema al momento de realizar la cancelación. ", 'status' => $ret->status,'mensaje' => $sErrMsg, 'params' => $params); $Resultado = json_encode($j_array); echo $Resultado; return; } $RespServ = $ret; $j_array = array('code' => "200", "message" => "Proceso de cancelacion de CFDI fue exitoso", 'status' => $ret->status, 'mensaje' => $ret->mensaje); $Resultado = json_encode($j_array); echo $Resultado; return;