codersfree/laravel-greenter
Paquete para emitir comprobantes electrónicos en Laravel con Greenter: firma digital, envío a SUNAT (SEE o REST), generación de XML firmados, manejo de CDR y representación impresa en HTML/PDF. Soporta emisión para múltiples empresas y envío de XML existente.
config/greenter.php.| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| SUNAT API Changes | SUNAT frequently updates schemas/APIs (e.g., new tax laws, XML versions). | Monitor SUNAT’s official docs and fork the package for patches. |
| PKCS12/OCSP Configuration | Misconfigured certificates can cause SUNAT rejections. | Implement pre-signing validation (e.g., test with SUNAT’s sandbox environment first). |
| XML Schema Validation | Custom document types (e.g., light invoices) may not be fully supported. | Extend the package via service providers or custom XML templates. |
| Performance | SUNAT API rate limits or slow responses could impact real-time operations. | Cache responses (e.g., rejected documents) and implement retry logic with exponential backoff. |
| Legacy System Integration | Existing ERP/legacy systems may not align with SUNAT’s data model. | Use Laravel queues to decouple document generation from SUNAT submission. |
Compliance Scope:
Signing Method:
Testing Strategy:
Error Handling:
Audit & Compliance:
Greenter\GreenterFacade::invoice()).config/greenter.php) for SUNAT credentials, endpoints, and signing methods.InvoiceGenerated, SunatResponseReceived) for custom logic (e.g., notifications, analytics).php-openssl enabled.php-xml is installed.sunat_document_id, status).| Phase | Action Items | Dependencies |
|---|---|---|
| 1. Setup & Validation | Install package (composer require codersfree/laravel-greenter). Publish config (php artisan vendor:publish --provider="Greenter\GreenterServiceProvider"). |
SUNAT credentials, PKCS12/OCSP setup. |
| 2. XML Generation | Test XML output for a sample invoice using the package’s sandbox mode. | Sample data (client, product, tax info). |
| 3. Signing & Local Validation | Validate locally generated XML against SUNAT’s XSD schemas. | SUNAT XSD files (download from SUNAT). |
| 4. Sandbox Testing | Submit test documents to SUNAT’s sandbox API and verify responses. | Sandbox credentials. |
| 5. Production Rollout | Deploy to staging, monitor SUNAT API calls, and validate against real responses. | Staging environment with live-like data. |
| 6. Monitoring | Set up Laravel Horizon or external monitoring for SUNAT API failures. | Logging (e.g., Laravel’s log channel). |
config/greenter.php across environments.How can I help you explore Laravel packages today?