PHP code example of tecfinite / zatca-qr

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

    

tecfinite / zatca-qr example snippets


use Tecfinite\ZatcaQr\Tag\InvoiceTotalTag as ZatcaInvoiceTotalTag;
use Tecfinite\ZatcaQr\Tag\SellerTag as ZatcaSellerTag;
use Tecfinite\ZatcaQr\Tag\TimestampTag as ZatcaTimestampTag;
use Tecfinite\ZatcaQr\Tag\VatRegistrationNumberTag as ZatcaVatRegistrationNumberTag;
use Tecfinite\ZatcaQr\Tag\VatTotalTag as ZatcaVatTotalTag;
use Tecfinite\ZatcaQr\ZatcaQr;

$qr = new Tecfinite\ZatcaQr();
$qr = new ZatcaQr(
            new ZatcaSellerTag($this->sellerName),
            new ZatcaVatRegistrationNumberTag($this->sellerTaxId),
            new ZatcaTimestampTag($this->invoice->created_at),
            new ZatcaInvoiceTotalTag($this->invoice->total_fee),
            new ZatcaVatTotalTag($this->invoice->vat_fee)
          );