Download the PHP package matiz-studio-creative/sri-toolkit without Composer
On this page you can find all versions of the php package matiz-studio-creative/sri-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download matiz-studio-creative/sri-toolkit
More information about matiz-studio-creative/sri-toolkit
Files in matiz-studio-creative/sri-toolkit
Package sri-toolkit
Short Description PHP toolkit for Ecuador SRI electronic documents: access keys, XML builders, XAdES-BES signing and SOAP delivery.
License MIT
Homepage https://sri-toolkit.matizstudiocreative.com
Informations about the package sri-toolkit
SRI Toolkit
A modern, robust, and framework-agnostic PHP toolkit for managing Ecuador's SRI (Servicio de Rentas Internas) electronic billing lifecycle.
It covers the complete workflow: 49-digit access key generation, XML generation with automated decimal totals, offline XSD and identity validation, XAdES-BES digital signing with PKCS#12 certificates, direct SOAP communication (reception, authorization, status querying, and batch processing), RIDE PDF rendering, and document storage.
Documentation
Comprehensive documentation, architectural details, and guides are available at: 👉 sri-toolkit.matizstudiocreative.com
Features
- Access Keys: Generation of the official 49-digit SRI access key using the modulo 11 algorithm.
- XML Generation: Compliant structure for the 6 SRI document types (Invoices, Purchase Settlements, Credit Notes, Debit Notes, Delivery Guides, and Withholding Receipts).
- Invoice Variants: Native support for export invoices (foreign trade), reimbursements, third-party charges, delivery-guide substitutes, fiscal machines, and vehicle plates.
- Exact Decimal Arithmetic: Automated balance and tax calculation derived from line items using exact decimal arithmetic (
brick/money), eliminating calculation-difference rejections. - Offline Validation: Pre-flight validation against official SRI XSD schemas and national ID check digits (Cédula / RUC) prior to signing and transmission.
- XAdES-BES Signing: Strict XMLDSig/XAdES-BES compliant digital signature using PKCS#12 (
.p12/.pfx) certificates. - SOAP Gateway: Fully typed client for Reception, Authorization, Status Querying (
ConsultaComprobante), and Batch processing (up to 50 documents / 500 kB). - Typed Responses & Error Categorization: Real-time classification of SRI error codes into retryable states, blocking impediments, or asynchronous processing queues.
- RIDE PDF Generation: Pre-built templates (rendered via Dompdf with Code128 barcodes) for all 6 document types.
- Multi-Driver Storage: Unified
DocumentStoresupporting local disk and Amazon S3 (with presigned URLs). - Encrypted Certificates: Utilities for storing PKCS#12 credentials with AES-256-GCM encryption at rest.
- End-to-End Pipeline: Unified emission orchestrator to generate, validate, sign, transmit, render RIDE, and store in a single execution flow.
- Testable Architecture: Fully mockable dependencies via interfaces (SOAP, Signer, Clock, Storage, Sleeper).
Requirements
- PHP: >= 8.2 (Tested on PHP 8.2, 8.3, 8.4, and 8.5)
- Extensions:
ext-soap,ext-openssl,ext-dom,ext-libxml - Package Manager: Composer
Installation
Install the package via Composer:
Supported Documents
| Code | Document Type | XML Version | Supported Features |
|---|---|---|---|
01 |
Invoice (Factura) | 2.1.0 |
Standard, Export, Reimbursements, Third-party charges |
03 |
Purchase Settlement (Liquidación de Compra) | 1.1.0 |
Standard, Reimbursements |
04 |
Credit Note (Nota de Crédito) | 1.1.0 |
Total/Partial modifications |
05 |
Debit Note (Nota de Débito) | 1.0.0 |
Value adjustments |
06 |
Delivery Guide (GuÃa de Remisión) | 1.1.0 |
Transportation and route tracking |
07 |
Withholding Receipt (Comprobante de Retención) | 2.0.0 |
Income Tax & VAT withholding |
Quick Start
Core Modules
1. Offline Validation
Prevent unnecessary network round-trips and official rejections by validating locally:
2. Status Inquiries & Error Classification
Inspect detailed messages returned by the SRI:
See Sender Module and SRI Error Codes.
3. RIDE PDF Generation
Render print-ready RIDE documents:
See RideGenerator.
4. Storage
Save artifacts to local storage or Amazon S3:
See Storage.
5. End-to-End Execution Pipeline
Execute all phases in a consolidated workflow:
See Pipeline Module.
6. Catalogs
Common SRI codes through a runtime-overridable registry based on technical sheet v2.34:
See Catalogs.
Development & Testing
Run the test suite and static analysis tools locally:
The documentation site is built with VitePress (pnpm docs:dev, pnpm docs:build).
Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
- Fork the repository (
https://github.com/Sebas-DV/sri-toolkit/fork). - Create your feature branch (
git checkout -b feature/amazing-feature). - Commit your changes with descriptive messages (
git commit -m 'Add support for withholding type X'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request against
main.
Please review CONTRIBUTING.md for full development standards and guidelines.
Security Policy
This package handles private keys, certificate passwords, signed XML, and taxpayer data.
- Store certificates outside the repository and web root.
- Keep passwords in a secret manager or protected environment variables.
- Avoid logging signed XML or SOAP traces in production.
- Review SECURITY.md for vulnerability disclosure protocols.
Disclaimer
This package is an open-source project and is not officially affiliated with or endorsed by the Servicio de Rentas Internas (SRI) of Ecuador.
License
Open-sourced software licensed under the MIT License.
All versions of sri-toolkit with dependencies
ext-dom Version *
ext-libxml Version *
ext-openssl Version *
ext-soap Version *
aws/aws-sdk-php Version ^3.381
brick/money Version ^0.15.2
dompdf/dompdf Version ^3.1
picqer/php-barcode-generator Version ^3.2
ramsey/uuid Version ^4.9
twig/twig Version ^3.0