1. Go to this page and download the library: Download metolabs/satcfdi-php 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/ */
$client->portal()->validateRfc('AAA010101AAA');
$client->portal()->validateLegalName('AAA010101AAA', 'ACME SA DE CV');
$client->portal()->lcoDetails('AAA010101AAA');
$capabilities = $client->capabilities();
if ($client->supports('csf.download')) {
// Supported by the installed bridge.
}
use MetoLabs\SAT\Cfdi\Exceptions\InvalidCredentialsException;
use MetoLabs\SAT\Cfdi\Exceptions\SatCfdiException;
use MetoLabs\SAT\Cfdi\Exceptions\UpstreamException;
try {
$pdf = $client->csf()->contents($fiel);
} catch (InvalidCredentialsException $e) {
// Invalid e.firma certificate, private key, or password.
} catch (UpstreamException $e) {
// SAT/upstream/network error.
} catch (SatCfdiException $e) {
// Other bridge or protocol error.
}
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.