VXML 2.0.0
dotnet add package VXML --version 2.0.0
NuGet\Install-Package VXML -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VXML" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VXML" Version="2.0.0" />
<PackageReference Include="VXML" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VXML --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VXML, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VXML@2.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VXML&version=2.0.0
#tool nuget:?package=VXML&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
VXML
Librería para la generación y cancelación de CFDI 4.0, incluidos todos los complementos vigentes. Incluye el proceso de firmado, Sellado y tambien el Timbrado por medio del servicio de VXML, de acuerdo a la especificación del SAT.
Uso
Uso Basico
using VXML;
...
// Crear instancia de la clase VXML
var vxml = new VXML();
// Llamar los metodos para el llenado del CFDI
vxml.SetComprobanteInfo_cfdi40("A", "1", DateTime.Now.ToString("s"), "99", "Contado A�A Comercial", "1000.00", "50.00", "MXN", "", "1102.00", "I", "PPD", "53050", "", "01");
vxml.AddCfdiRelacionados_cfdi40("04", "FF93C8BE-AF7B-4FC5-8854-6DAE18CFB5B4", "D8E18C2F-2859-4927-A0F0-EA3E93642DDC", "", "", "", "", "", "", "", "");
vxml.AddCfdiRelacionado_cfdi40("BE1D4B47-E167-47A3-8049-70D4D43BCBE8");
vxml.AddCfdiRelacionados_cfdi40("01", "FDBA380A-9732-4FB5-A6CB-5FB4BD831697", "", "", "", "", "", "", "", "", "");
vxml.SetEmisorInfo_cfdi40("EKU9003173C9", "ESCUELA KEMPER URGATE", "601", "");
// Tambien puede usarse de forma encadenada
vxml.SetReceptorInfo_cfdi40("CTE940531F58", "CIBERNETICA Y TECNOLOGIA", "", "", "G01", "53050", "601")
.AddConcepto_cfdi40("84111506", "SEFXXX �", "1", "H87", "Unidad", "Paquete X - ObjetoImp2", "500.00", "500.00", "", "02")
.AddConceptoTraslado_cfdi40("500.00", "002", "Tasa", "0.160000", "80.00")
.AddConcepto_cfdi40("84111506", "SEFXXX &", "2", "H87", "Unidad", "Paquete X - ObjetoImp2", "250.00", "500.00", "50.00", "02")
.AddConceptoTraslado_cfdi40("450.00", "002", "Tasa", "0.160000", "72.00")
.SetImpuestosInfo_cfdi40("200.00", "300.0");
vxml.SetImpuestosInfo_cfdi40("152.00", "");
vxml.AddTraslado_cfdi40("002", "Tasa", "0.160000", "152.00", "950.00");
vxml.SetAddendaText_cfdi40("Texto simple como adenda");
// Finalmente, solicitar el timbrado
var resultado = await vxml.TimbraCFDI40("demo_cibertec", "EKU9003173C9", csdPath, keyPath, "12345678a", true, true, true, true);
// Evaluar el resultado
if (resultado.IsSuccess)
{
Console.WriteLine("UUID: {0}", resultado.uuid);
var rawXML = Encoding.UTF8.GetString(Convert.FromBase64String(resultado.xmltimbrado));
Console.WriteLine("XML: {0}", rawXML);
if (resultado.qrpng != null)
{
await File.WriteAllBytesAsync("Somewhere/Path/QR.png", resultado.qrpng);
Console.WriteLine("png QR written");
}
if (resultado.qrccp30png != null)
{
using var ms = new MemoryStream(resultado.qrccp30png);
ms.WriteTo(new FileStream("Somewhere/Path/QRcpp.png", FileMode.Create));
Console.WriteLine("QR de Complemento Carta Porte guardado");
}
}
else
{
Console.WriteLine("Algo falo con codigo {0} y mensaje {1}", resultado.InnerExitCode, resultado.Message);
}
Ejemplos
Complemento Pagos20
var vxml = new Cfdi();
vxml.AddCfdiRelacionados_cfdi40("01", "", "00000000-0000-0000-0000-000000000002", "", "00000000-0000-0000-0000-000000000004", "", "00000000-0000-0000-0000-000000000006", "", "00000000-0000-0000-0000-000000000008", "", "00000000-0000-0000-0000-000000000010");
vxml.AddCfdiRelacionado_cfdi40("00000000-0000-0000-0000-111111111111");
vxml.AddCfdiRelacionados_cfdi40("02", "00000000-0000-0000-0000-000000000001", "", "00000000-0000-0000-0000-000000000003", "", "00000000-0000-0000-0000-000000000005", "", "00000000-0000-0000-0000-000000000007", "", "00000000-0000-0000-0000-000000000009", "");
vxml.AddCfdiRelacionado_cfdi40("00000000-0000-0000-0000-222222222222");
vxml.SetInformacionGlobal_cfdi40("01", "10", "2023");
vxml.SetComprobanteInfo_cfdi40("", "12629", DateTime.Now.ToString("s"), "", "", "0", "", "XXX", "", "0", "P", "", "53000", "", "01");
vxml.SetEmisorInfo_cfdi40("EKU9003173C9", "ESCUELA KEMPER URGATE", "601", "");
vxml.SetReceptorInfo_cfdi40("ESD140725UP8", "\"E-SI SOLUCIONES DIGITALES\"", "", "", "CP01", "53050", "601");
vxml.AddConcepto_cfdi40("84111506", "", "1", "ACT", "", "Pago", "0", "0", "", "01");
vxml.SetPagos20("", "", "", "", "", "", "", "", "", "", "34925.52");
vxml.Pagos20AddPago("2021-01-01T01:01:01", "03", "USD", "1.00", "13144.66", "0000842", "", "", "", "", "", "", "", "", "");
vxml.Pagos20AddPagoDoctoRelacionado("88888888-4444-4444-4444-121212121212", "Serie", "Folio", "USD", "1", "2", "13144.66", "13144.66", "0.00", "01");
vxml.Pagos20AddPago("2021-02-02T02:02:02", "03", "USD", "1.00", "21780.86", "0000842", "", "", "", "", "", "", "", "", "");
vxml.Pagos20AddPagoDoctoRelacionado("AAAAAAAA-0000-0000-0000-666666666666", "Serie2", "Folio2", "USD", "1", "3", "14430.86", "14430.86", "0.00", "01");
vxml.Pagos20AddPagoDoctoRelacionado("AAAAAAAA-BBBB-CCCC-DDDD-666666666666", "Serie3", "Folio3", "USD", "1", "4", "7350.00", "7350.00", "0.00", "03");
// Para uso de la addenda como XML, el nodo especificado en la funcion
// debera contener la declaracion de los namespaces en caso de usarlos
vxml.SetAddendaXml_cfdi40("<MyOwnNode name=\"CFDI40\"><AnyChildNode data=\"Pagos20\" /></MyOwnNode>");
// Custom Namespace
// vxml.SetAddendaXml_cfdi40("<MyOwnNode name=\"CFDI40\"><customNS:AnyChildNode data=\"Pagos20\" xmlns:customNS=\"http://acme.company.org\"/></MyOwnNode>");
Complemento Carta Porte 3.1
var vxml = new Cfdi();
vxml.SetComprobanteInfo_cfdi40("RogueOne", "HNFK231", DateTime.Now.ToString("s"), "01", "", "100.00", "", "MXN", "1", "100.00", "I", "PUE", "06300", "", "01");
vxml.SetEmisorInfo_cfdi40("EKU9003173C9", "ESCUELA KEMPER URGATE", "601", "");
vxml.SetReceptorInfo_cfdi40("ESD140725UP8", "\"E-SI SOLUCIONES DIGITALES\"", "", "", "CP01", "53050", "601");
vxml.AddConcepto_cfdi40("78101800", "UT421511", "1", "H87", "Pieza", "Transporte de carga por carretera", "100.00", "100.00", "", "01");
vxml.SetCartaPorte31("CCCBCD94-870A-4332-A52A-A52AA52AA52A", "No", "", "", "", "1", "S�", "01", "01");
vxml.CartaPorte31AddUbicacion("Origen", "OR101010", "EKU9003173C9", "NombreRemitenteDestinatario1", "", "", "", "", "", "2023-08-01T00:00:00", "", "", "Calle1", "211", "212", "1957", "13", "casa blanca", "011", "CMX", "MEX", "13250");
vxml.CartaPorte31AddUbicacion("Destino", "DE202020", "EKU9003173C9", "NombreRemitenteDestinatario2", "", "", "", "", "", "2023-08-01T00:00:01", "", "1", "Calle2", "214", "215", "0347", "23", "casa negra", "004", "COA", "MEX", "25350");
vxml.CartaPorte31SetMercancias("1.0", "XBX", "1", "1", "", "S�");
vxml.CartaPorte31AddMercancia("11121900", "", "Accesorios de equipo de telefon�a", "1.0", "XBX", "", "", "No", "", "", "", "", "", "", "DenominacionGenericaProd1", "DenominacionDistintivaProd1", "Fabricante1", "2028-01-01", "LoteMedic1", "01", "01", "RegistroSanita1", "", "", "", "", "", "", "", "", "", "1", "", "", "", "", "", "");
vxml.CartaPorte31AddMercanciaCantidadTransporta("1", "OR101010", "DE202020", "");
vxml.CartaPorte31AddFiguraTransporteTiposFigura("01", "VAAM130719H60", "a234567890", "NombreFigura", "", "", "", "", "", "", "", "", "", "", "", "", "");
vxml.CartaPorte31SetMercanciasAutotransporte("TPAF01", "NumPermisoSCT1", "VL", "1", "plac892", "2020", "AseguraRespCivil", "123456789", "", "", "", "", "", "CTR004", "VL45K98", "", "");
vxml.SetAddendaXml_cfdi40("<MyOwnNode name=\"CFDI40\"><AnyChildNode data=\"CartaPorte31\" /></MyOwnNode>");
Características
- Generación de CFDI 4.0
- Generación de todos los complementos vigentes:
- [Complementos y Complementos Concepto]
- Generación de representacion impresa simple (PDF)
- Generación de Codigo de Barras Bidimensional en formatos: png, jpg y bmp
- Sellado local (tu llave privada y clave son usadas localmente)
- Manejo de errores y logging
Requisitos técnicos
- .NET 6.0 o superior
Requerimientos de servicio
- Contar con un CSD vigente (Certificado de Sello Digital).
- Contar con los archivos .cer, .key
- Contar con la clave del archivo .key
- En caso de desear timbrar con credenciales diferentes al demo; haber contratado un plan de timbres con VXML
NOTA: Los archivos .cer/.key de la FIEL no funcionan para el proceso de timbrado, deberan usarse los del CSD
Información DEMO
Estas credenciales pueden usarse sin necesidad de ningun tipo de registro
- usuario: demo_cibertec
- rfcemisor: EKU9003173C9
- Certificado Emisor: CSD_EKU9003173C9.cer
- Llave Privada Emisor: CSD_EKU9003173C9.key
- Clave Llave Privada: 12345678a
Contacto
- Correo electronico: soporte@ciber-tec.com
Licencia
Este proyecto se rige bajo la licencia MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Console (>= 6.0.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Console (>= 6.0.0)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Console (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 297 | 9/19/2025 |