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
<PackageReference Include="Acontplus.Common.FactElect" Version="0.4.2" />
<PackageVersion Include="Acontplus.Common.FactElect" Version="0.4.2" />
<PackageReference Include="Acontplus.Common.FactElect" />
paket add Acontplus.Common.FactElect --version 0.4.2
#r "nuget: Acontplus.Common.FactElect, 0.4.2"
#addin nuget:?package=Acontplus.Common.FactElect&version=0.4.2
#tool nuget:?package=Acontplus.Common.FactElect&version=0.4.2
Acontplus.Common.FactElect
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
Company
Product | Versions 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. |
-
net9.0
- Acontplus.Common.Barcode (>= 0.1.6)
- Acontplus.Common.Core (>= 1.5.9)
- Acontplus.Common.Utilities (>= 0.3.4)
- BCrypt.Net-Next (>= 4.0.3)
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.6)
- Newtonsoft.Json (>= 13.0.3)
- SkiaSharp.NativeAssets.Linux (>= 3.116.1)
- System.Drawing.Common (>= 9.0.6)
- ZXing.Net (>= 0.16.10)
- ZXing.Net.Bindings.SkiaSharp (>= 0.16.21)
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 |