PHP code example of xidmonx / cfdi

1. Go to this page and download the library: Download xidmonx/cfdi 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/ */

    

xidmonx / cfdi example snippets


use xIDMONx\CFDI\CFDI;

$cer = file_get_contents('XAX010101000.cer.pem');
$key = file_get_contents('XAX010101000.key.pem');

$cfdi = new CFDI([
    'Serie'             => 'A',
    'Folio'             => 'A0101',
    'Fecha'             => '2020-06-23T09:23:32',
    'FormaPago'         => '01',
    'NoCertificado'     => '00000000000000000000',
    'CondicionesDePago' => '',
    'SubTotal'          => '',
    'Descuento'         => '0.00',
    'Moneda'            => 'MXN',
    'TipoCambio'        => '1.0',
    'Total'             => '',
    'TipoDeComprobante' => 'I',
    'MetodoPago'        => 'PUE',
    'LugarExpedicion'   => '64000',
], $cer, $key);