codersfree/laravel-greenter
Paquete para Laravel que permite emitir comprobantes electrónicos con Greenter: firma digital, envío a SUNAT (SEE o API REST), gestión de CDRs, generación de XML firmados y representación impresa en HTML y PDF, con soporte para múltiples empresas emisoras.
composer.json before committing to an upgrade.config/greenter.php.| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Major-Version Support Drop | v2.x may have removed Laravel 8–10 support to accommodate Laravel 13. | Review the full 2.0.0 → 2.0.1 changelog and composer.json constraints; pin explicitly. |
| PHP Floor Bump | Laravel 13 targets a newer PHP runtime; servers on PHP 8.0/8.1 may be excluded. | Audit runtime images and CI matrix before upgrading. |
| SUNAT API Changes | SUNAT frequently updates schemas/APIs (new tax laws, XML versions). | Monitor SUNAT's official docs; fork the package for patches. |
| PKCS12/OCSP Configuration | Misconfigured certificates cause SUNAT rejections. | Implement pre-signing validation; test against SUNAT's sandbox first. |
| XML Schema Validation | Custom document types (e.g., light invoices) may not be fully supported. | Extend via service providers or custom XML templates. |
| Performance | SUNAT API rate limits or slow responses impact real-time operations. | Cache responses (e.g., rejected documents); 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. |
Greenter\GreenterFacade::invoice()).config/greenter.php) for SUNAT credentials, endpoints, and signing methods.InvoiceGenerated, SunatResponseReceived) for custom logic (notifications, analytics).php-openssl) for PKCS12 signing; DOM/SimpleXML (php-xml) for XML parsing.sunat_document_id, status).| Phase | Action Items | Dependencies |
|---|---|---|
| 0. Version Audit (New) | Diff composer.json between the 1.x and 2.x lines; record Laravel/PHP support windows and breaking changes. |
Repository access, changelog. |
| 1. Setup & Validation | composer require codersfree/laravel-greenter (pin to a tested constraint). 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 sandbox mode. | Sample data (client, product, tax info). |
| 3. Signing & Local Validation | Validate generated XML against SUNAT's XSD schemas. | SUNAT XSD files. |
| 4. Sandbox Testing | Submit test documents to SUNAT's sandbox API; verify responses. | Sandbox credentials. |
| 5. Production Rollout | Deploy to staging, monitor SUNAT API calls, validate against real responses. | Staging environment with live-like data. |
| 6. Monitoring | Set up Laravel Horizon or external monitoring for SUNAT API failures. | Logging (Laravel log channel). |
composer.json — a major-version line change may mean older majors are no longer maintained. Maintain an explicit version pin and upgrade deliberately.config/greenter.php across environments.| Failure | Blast Radius | Detection / Response |
|---|---|---|
| SUNAT endpoint outage or timeout | Invoices unsubmitted; revenue recognition delayed | Queue retries with exponential backoff; surface pending state in UI |
| Certificate expiry / misconfiguration | 100% rejection rate | Scheduled expiry alerts; pre-signing validation gate |
| SUNAT schema change | Silent validation rejections | Raw response logging + rejection dashboards |
| Package abandoned / slow patching | Compliance gap | Fork readiness; documented patch runbook |
| Framework upgrade regression (2.x) | Broken invoicing on deploy | CI matrix across supported Laravel/PHP combos; staging soak test |
How can I help you explore Laravel packages today?