Acontplus.FactElect 1.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Acontplus.FactElect --version 1.2.2
                    
NuGet\Install-Package Acontplus.FactElect -Version 1.2.2
                    
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="Acontplus.FactElect" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Acontplus.FactElect" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Acontplus.FactElect" />
                    
Project file
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 Acontplus.FactElect --version 1.2.2
                    
#r "nuget: Acontplus.FactElect, 1.2.2"
                    
#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 Acontplus.FactElect@1.2.2
                    
#: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=Acontplus.FactElect&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Acontplus.FactElect&version=1.2.2
                    
Install as a Cake Tool

Acontplus.FactElect

NuGet .NET License: MIT

A comprehensive .NET 9+ library for electronic invoicing and digital document handling in Ecuador, providing models, services, and utilities to facilitate integration with SRI (Servicio de Rentas Internas) systems.

πŸš€ Features

  • Electronic document models (invoices, credit notes, etc.)
  • XML document generation, validation, and parsing
  • SRI (Ecuadorian Tax Authority) web service integration
  • Document validation and verification
  • CAPTCHA handling for human verification processes
  • ID card (cΓ©dula) and RUC validation
  • XML to HTML/PDF document conversion
  • Token-based authentication management
  • Dependency Injection support

πŸ“¦ Installation

NuGet Package Manager

Install-Package Acontplus.FactElect

.NET CLI

dotnet add package Acontplus.FactElect

PackageReference

<ItemGroup>
  <PackageReference Include="Acontplus.FactElect" Version="1.0.17" />
</ItemGroup>

🎯 Quick Start

1. Configure Services

// In Startup.cs or Program.cs
services.AddFactElectServices(Configuration);

2. Configuration in appsettings.json

{
  "FactElect": {
    "Environment": "Development",
    "ValidateBeforeSend": true,
    "DefaultTimeoutSeconds": 30,
    "DocumentStoragePath": "Documents",
    "CompanyRuc": "0991234567001",
    "CompanyLegalName": "ACME COMPANY S.A.",
    "CompanyCommercialName": "ACME",
    "EnableCaching": true,
    "CacheDurationMinutes": 60,
    "SriConnection": {
      "BaseUrl": "https://celcer.sri.gob.ec/",
      "TimeoutSeconds": 30,
      "MaxRetryAttempts": 3,
      "ValidateSslCertificate": true
    }
  }
}

3. Usage Examples

Validate Ecuadorian ID Card
public class IdentityValidator
{
    private readonly ICedulaService _cedulaService;
    public IdentityValidator(ICedulaService cedulaService) => _cedulaService = cedulaService;
    public bool ValidateIdentity(string cedula) => _cedulaService.ValidateCedula(cedula);
}
Generate Electronic Invoice XML
public class InvoiceGenerator
{
    private readonly IXmlService _xmlService;
    public InvoiceGenerator(IXmlService xmlService) => _xmlService = xmlService;
    public string GenerateInvoice(ComprobanteElectronico comprobante) => _xmlService.GenerateInvoiceXml(comprobante);
}
Send Document to SRI
public class DocumentSender
{
    private readonly ISriWebService _sriService;
    public DocumentSender(ISriWebService sriService) => _sriService = sriService;
    public async Task<ResponseSri> SendDocumentAsync(string xmlContent, string username, string password)
    {
        var token = await _sriService.AuthenticateAsync(username, password);
        return await _sriService.SendDocumentAsync(xmlContent, token);
    }
}
Convert XML to HTML for Display
public class DocumentRenderer
{
    private readonly IDocumentConverter _converter;
    public DocumentRenderer(IDocumentConverter converter) => _converter = converter;
    public string RenderDocument(string xmlContent) => _converter.ConvertToHtml(xmlContent);
}

πŸ“š API Documentation

  • ICedulaService, IRucService - Ecuadorian ID and RUC validation
  • IXmlService - XML generation and parsing
  • ISriWebService - SRI integration and authentication
  • IDocumentConverter - XML to HTML/PDF conversion
  • ComprobanteElectronico - Electronic document model
  • ResponseSri - SRI response model

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

git clone https://github.com/Acontplus-S-A-S/acontplus-dotnet-libs.git
cd acontplus-dotnet-libs
dotnet restore
dotnet build

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

  • πŸ“§ Email: proyectos@acontplus.com
  • πŸ› Issues: GitHub Issues
  • πŸ“– Documentation: Wiki

πŸ‘¨β€πŸ’» Author

Ivan Paz - @iferpaz7

🏒 Company

Acontplus S.A.S. - Enterprise software solutions


Built with ❀️ for the .NET community

Product Compatible and additional computed target framework versions.
.NET 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.

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
1.2.3 44 7/18/2025
1.2.2 129 7/15/2025
1.2.1 124 7/15/2025
1.2.0 127 7/14/2025
1.1.0 128 7/14/2025
1.0.21 72 7/11/2025
1.0.20 76 7/11/2025
1.0.19 132 7/10/2025
1.0.18 126 7/10/2025
1.0.17 119 7/10/2025
1.0.16 122 7/9/2025
1.0.15 125 7/9/2025
1.0.14 122 7/9/2025
1.0.13 120 7/7/2025
1.0.12 119 7/6/2025
1.0.11 116 7/6/2025
1.0.10 117 7/6/2025
1.0.9 67 7/4/2025
1.0.8 124 7/3/2025
1.0.7 124 7/2/2025
1.0.6 130 7/2/2025
1.0.5 131 7/1/2025

Updated for .NET 9+ with async/await, SRI integration, and enhanced documentation.