Acontplus.Common.FactElect 0.4.2

dotnet add package Acontplus.Common.FactElect --version 0.4.2
                    
NuGet\Install-Package Acontplus.Common.FactElect -Version 0.4.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.Common.FactElect" Version="0.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Acontplus.Common.FactElect" Version="0.4.2" />
                    
Directory.Packages.props
<PackageReference Include="Acontplus.Common.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.Common.FactElect --version 0.4.2
                    
#r "nuget: Acontplus.Common.FactElect, 0.4.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.
#addin nuget:?package=Acontplus.Common.FactElect&version=0.4.2
                    
Install Acontplus.Common.FactElect as a Cake Addin
#tool nuget:?package=Acontplus.Common.FactElect&version=0.4.2
                    
Install Acontplus.Common.FactElect as a Cake Tool

Acontplus.Common.FactElect

NuGet License: MIT

A comprehensive .NET 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.

Overview

Acontplus.Common.FactElect is a specialized .NET package that provides essential tools for electronic invoicing and digital document processing according to Ecuadorian tax regulations. The library handles captcha validation, XML document generation, SRI integration, and more.

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

Install the package via NuGet Package Manager:

Install-Package Acontplus.Common.FactElect

Or via .NET CLI:

dotnet add package Acontplus.Common.FactElect

Quick Start

Configure Services

Add FactElect services to your dependency injection container:

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

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
    }
  }
}

Usage Examples

Validating an Ecuadorian ID Card
// Using dependency injection
public class IdentityValidator
{
    private readonly ICedulaService _cedulaService;

    public IdentityValidator(ICedulaService cedulaService)
    {
        _cedulaService = cedulaService;
    }

    public bool ValidateIdentity(string cedula)
    {
        return _cedulaService.ValidateCedula(cedula);
    }
}
Generating an Electronic Invoice XML
// Using dependency injection
public class InvoiceGenerator
{
    private readonly IXmlService _xmlService;

    public InvoiceGenerator(IXmlService xmlService)
    {
        _xmlService = xmlService;
    }

    public string GenerateInvoice(ComprobanteElectronico comprobante)
    {
        return _xmlService.GenerateInvoiceXml(comprobante);
    }
}
Sending a Document to SRI
// Using dependency injection
public class DocumentSender
{
    private readonly ISriWebService _sriService;

    public DocumentSender(ISriWebService sriService)
    {
        _sriService = sriService;
    }

    public async Task<ResponseSri> SendDocumentAsync(
        string xmlContent, 
        string username, 
        string password)
    {
        // Authenticate with SRI
        var token = await _sriService.AuthenticateAsync(username, password);
        
        // Send document to SRI
        return await _sriService.SendDocumentAsync(xmlContent, token);
    }
}
Converting XML to HTML for Display
// Using dependency injection
public class DocumentRenderer
{
    private readonly IDocumentConverter _converter;

    public DocumentRenderer(IDocumentConverter converter)
    {
        _converter = converter;
    }

    public string RenderDocument(string xmlContent)
    {
        return _converter.ConvertToHtml(xmlContent);
    }
}

Project Structure

Acontplus.Common.FactElect/
│
├── Configuration/        # Configuration settings
├── Constants/            # Constants and enumerations
├── Exceptions/           # Custom exceptions
├── Extensions/           # Extension methods
├── Interfaces/           # Service interfaces
├── Models/               # Domain models
│   ├── Authentication/
│   ├── Documents/
│   ├── Responses/
│   └── Validation/
├── Resources/            # Resource files
│   ├── Images/
│   └── Schemas/
├── Services/             # Service implementations
│   ├── Authentication/
│   ├── Conversion/
│   ├── Documents/
│   ├── External/
│   └── Validation/
└── Utilities/            # Helper classes

Requirements

  • .NET Standard 2.0+ or .NET 8.0+
  • Internet connection for SRI web service integration

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

Author

Ivan Paz

Company

Acontplus S.A.S.

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
0.4.2 133 6/12/2025
0.4.1 130 6/12/2025
0.4.0 137 6/11/2025
0.3.3 132 6/11/2025
0.3.2 139 6/11/2025
0.3.1 134 5/29/2025
0.3.0 136 5/29/2025
0.2.7 133 5/28/2025
0.2.6 133 5/27/2025
0.2.5 130 5/27/2025
0.2.4 133 5/26/2025
0.2.3 136 5/26/2025
0.2.2 144 5/26/2025
0.2.1 134 5/26/2025
0.2.0 130 5/26/2025
0.1.18 92 5/25/2025
0.1.17 136 5/21/2025
0.1.16 132 5/21/2025
0.1.15 159 5/16/2025
0.1.14 160 5/16/2025
0.1.13 198 5/16/2025
0.1.12 236 5/13/2025
0.1.11 219 5/12/2025
0.1.10 205 5/12/2025
0.1.9 135 5/7/2025
0.1.8 137 5/7/2025
0.1.7 168 4/24/2025
0.1.6 155 4/22/2025
0.1.5 196 4/17/2025
0.1.4 184 4/17/2025
0.1.3 186 4/17/2025
0.1.2 184 4/17/2025
0.1.1 185 4/16/2025
0.1.0 116 2/20/2025