PHP code example of nowo-tech / verifactu-bundle

1. Go to this page and download the library: Download nowo-tech/verifactu-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nowo-tech / verifactu-bundle example snippets




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

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;
}