nowo-tech/verifactu-bundle

Symfony bundle for Spanish Veri*Factu (RD 1007/2023) billing record compliance: SHA-256 hash chains, XML generation, QR codes, and AEAT submission hooks

Maintainers

Package info

github.com/nowo-tech/VerifactuBundle

Type:symfony-bundle

pkg:composer/nowo-tech/verifactu-bundle

Transparency log

Fund package maintenance!

HecFranco

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-18 15:25 UTC

This package is auto-updated.

Last update: 2026-07-18 15:33:59 UTC


README

CI Packagist Version Packagist Downloads License PHP Symfony Coverage

Found this useful? Give it a star on GitHub! It helps us maintain and improve the project.

Symfony bundle for Spanish Veri*Factu compliance (RD 1007/2023) — SHA-256 hash chains, billing record XML, AEAT QR codes, validation, and submission hooks for SIF-compatible invoicing systems.

Features

  • Hash chain (SHA-256): AEAT-compliant fingerprint calculation and encadenamiento
  • Billing record XML: Registro de facturación generation (Alta / Anulación)
  • QR codes: ISO/IEC 18004 QR with AEAT verification URL and mandatory legend
  • Business rules validation: NIF/CIF/NIE, dates, amounts, invoice types
  • Symfony events: Before/after generation and AEAT submission hooks
  • Console commands: Validate records and verify hashes from CLI
  • Twig helpers: verifactu_qr_data_uri, verifactu_qr_url, verifactu_legend
  • Pluggable storage: HashChainRepositoryInterface with in-memory and Doctrine backends
  • AEAT SOAP client: mTLS submission to sandbox/production with client certificate
  • XAdES signing: No-Veri*Factu modalidad with PKCS#12/PEM certificates
  • XSD validation: Official AEAT schemas shipped with the bundle
  • Nowo integration: InvoiceDraft + InvoiceToBillingRecordMapper for ERP adoption
  • Sandbox CLI: nowo:verifactu:submit-sandbox smoke-test command
  • VeriFactu and No-VeriFactu modes: Configuration-driven behaviour
  • i18n: Validation messages in 7 locales (en, es, it, fr, pt, de, nl)

Installation

composer require nowo-tech/verifactu-bundle

Register the bundle in config/bundles.php:

<?php

return [
    // ...
    Nowo\VerifactuBundle\NowoVerifactuBundle::class => ['all' => true],
];

Usage

See docs/USAGE.md for the full API. Quick example:

use Nowo\VerifactuBundle\Model\BillingRecord;
use Nowo\VerifactuBundle\Model\RecordType;
use Nowo\VerifactuBundle\Service\BillingRecordProcessor;

/** @var BillingRecordProcessor $processor */
$processor = $container->get('nowo_verifactu.service.billing_record_processor');

$result = $processor->process(new BillingRecord(
    RecordType::Alta,
    issuerNif: '89890001K',
    invoiceSeriesNumber: 'FAC-2026-001',
    issueDate: '09-07-2026',
    invoiceType: 'F1',
    totalTaxAmount: '21.00',
    totalAmount: '121.00',
    generatedAt: '2026-07-09T16:00:00+02:00',
), submitToAeat: true);

if ([] === $result['errors']) {
    echo $result['record']->hash;
    echo $result['record']->xml;
}

Documentation

Additional documentation

Demo

Symfony 8 demo with FrankenPHP:

make -C demo/symfony8 up
# Open http://localhost:8010

Tests and coverage

  • Tests: PHPUnit (PHP)
  • PHP: ~98% (116 tests; target ~100% per REQ-TEST-003; minimum 80% enforced in CI)
  • TS/JS: N/A
  • Python: N/A

Exclusions documented in docs/SPEC-DRIVEN-DEVELOPMENT.md.

make up && make install && make test
make test-coverage
make release-check

License

This bundle is released under the MIT License.

Author

Created by Nowo.tech