Download the PHP package taiwanleaftea/tlt-verifactu without Composer

On this page you can find all versions of the php package taiwanleaftea/tlt-verifactu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tlt-verifactu

TLT Verifactu

A Laravel package for EU VAT validation and VERIFACTU support. This package can be used with any invoicing system (SIF). You must submit the declaration of responsibility (declaración responsable) for your system yourself.

Please note: The tax regimes for the Canary Islands, Ceuta, and Melilla are not supported.

Installation

Prerequisites

PHP 8.3 or above with the dom, json, libxml, openssl, and soap extensions installed and enabled. Laravel 12 or above is required.

Requirements for QR Code Generator

OpenSSL Configuration

The Spanish FNMT certification authority uses outdated encryption algorithms that are not supported by OpenSSL 3.0 and above.

For OpenSSL 3.0 or later, you must enable legacy encryption methods. To do this, open your openssl.conf (e.g., /etc/ssl/openssl.cnf on Ubuntu/Debian) and add the following:

To install the package, run:

The package will be installed, and config/tlt-verifactu.php will be published.

Edit the published config file and replace the software provider and system values (provider_name, provider_nif, provider_country, provider_id_type, system_name, etc.) with the values for your invoicing system. These values are intentionally plain Laravel config values because each application should commit the SIF/provider configuration it uses.

Run the package migration before generating VERIFACTU records:

You can also publish the migration first:

Open your .env file and add VERIFACTU_PRODUCTION (set it to true to use the production AEAT server) and VERIFACTU_DISK (the disk where certificates are stored). VERIFACTU_MODE can be used to select the operating mode, and VERIFACTU_REGISTRY_SCOPE can be used to separate local registry chains for different SIF instances. VERIFACTU_ENABLE_CANCEL_INVOICE_IN_PRODUCTION is available as an emergency/fallback switch for RegistroAnulacion in production and defaults to false.

VERIFACTU Configuration

The package supports two operating modes:

Optional local registry scope:

Leave it null for a single SIF chain. Set a stable value when one backend must keep separate local chains for different SIF instances.

Optional online record signing:

This is intentionally a config-only option. Set it to true only if you want online VERIFACTU records to be signed with XAdES-EPES before SOAP submission.

Representative/apoderado certificates:

By default, the package checks that the certificate subject NIF matches the invoice issuer NIF before online submission or no VERIFACTU signing. Set this config-only option to true only when the certificate belongs to an authorized representative (apoderado or colaborador social) for that issuer.

Cancel invoice fallback:

cancelInvoice() / RegistroAnulacion is available for sandbox fallback scenarios. It receives the local VerifactuRecord model or verifactu_records.id and builds the cancellation record from the local registry. In production it is blocked unless this option is explicitly enabled. Normal corrections should use subsanateInvoice() or submitRectificationInvoice().

Use cancelInvoice() with the local verifactu_records.id or a VerifactuRecord model:

cancelInvoiceByRecordId() remains as a backward-compatible alias. cancelInvoice() also accepts explicit sin_registro_previo and rechazo_previo options for documented RegistroAnulacion edge cases.

Local Registry Database

The package provides a verifactu_records table for local registry storage. It stores:

If the table already exists, the migration fails with a clear message instead of overwriting an existing registry. The Taiwanleaftea\TltVerifactu\Models\VerifactuRecord Eloquent model is available with casts for record_type (VerifactuRecordType), invoice_type (InvoiceType), invoice_payload, and response_json. It also provides getPreviousRecord(), getPreviousRecordId(), and getPreviousHash() helpers for the record's issuer_nif / registry_scope chain.

Usage

VAT Number Validator

VERIFACTU Service

Register Invoice

Multiple VAT Breakdown Details

Use invoiceData['breakdown'] when an invoice must generate more than one DetalleDesglose. The array can contain up to 12 detail rows. When breakdown is provided, base, vat, and rate are calculated from the detail rows:

Register Simplified Invoice

Use submitSimplifiedInvoice() for F2 invoices without recipient identification. The method sets InvoiceType::SIMPLIFIED internally, so invoiceData does not need a type key:

Subsanation and Rectification

Use subsanateInvoice() when an accepted registry record must be corrected with Subsanacion=S. Pass the local verifactu_records.id or a VerifactuRecord model of the record being corrected; the method reads the registry record and the latest chain record from the local registry:

For special AEAT operativa after a previous rejection or when the record is not in AEAT, pass rechazo_previo explicitly to submitInvoice() together with subsanacion:

Use submitRectificationInvoice() for a factura rectificativa. Pass the local verifactu_records.id or a VerifactuRecord model of the invoice being rectified. The method reads the issuer, recipient, original invoice identity, original amounts, and latest chain record from the local registry's invoice_payload. Pass the new rectification invoice number in invoiceData; other values can be overridden when necessary:

Rectifying invoices are generated only as TipoRectificativa=I (por diferencias). By default the package derives a credit note with negative base, VAT, and total values from invoice_payload. TipoRectificativa=S (por sustitución) is intentionally not implemented. The rectification invoice type defaults to R4, or R5 when the rectified invoice was simplified; pass type in invoiceData to use another R1-R5 value.

Your ERP invoice table should store a foreign key to verifactu_records.id for the generated VERIFACTU record. That key is what later ties the ERP invoice to subsanateInvoice() and submitRectificationInvoice() without relying on invoice number/date lookups.

To inspect the current chain head for a registry sequence, use:

Passing a recordId makes the package derive issuer_nif and registry_scope from that registry row. You can also select the chain explicitly:

Local Registry and No VERIFACTU

For a no VERIFACTU registry, set:

Then configure a signing certificate before generating records:

In no_verifactu mode, every RegistroAlta is signed immediately with XAdES-EPES and stored with signature metadata:

The package currently stores the no VERIFACTU registry but does not yet provide an export/remisión por requerimiento builder.

In online mode, submitInvoice() also creates a local verifactu_records row after AEAT responds. The table stores the unsigned record XML, a XAdES-EPES signed copy, CSV/status/error data, raw AEAT response, and presentation timestamps when available. The XML sent to AEAT remains unsigned unless online_sign_records is set to true.

Correct accepted records with subsanateInvoice() when the change belongs to the VERIFACTU record itself, or issue a factura rectificativa with submitRectificationInvoice() when the invoice content must be corrected.

cancelInvoice() remains available as a sandbox fallback API for RegistroAnulacion. In production it returns an error unless VERIFACTU_ENABLE_CANCEL_INVOICE_IN_PRODUCTION=true is set. cancelInvoiceByRecordId() is kept as a backward-compatible alias.

QR Code Generation

License

TLT Verifactu is licensed under the MIT License. See the LICENSE file for more information.


All versions of tlt-verifactu with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-dom Version *
ext-json Version *
ext-libxml Version *
ext-openssl Version *
ext-soap Version *
chillerlan/php-qrcode Version ^6.0
illuminate/database Version ^12.0
illuminate/filesystem Version ^12.0
illuminate/support Version ^12.0
robrichards/xmlseclibs Version ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package taiwanleaftea/tlt-verifactu contains the following files

Loading the files please wait ...