Skip to content

Commit da42f7b

Browse files
committed
example updated
1 parent b844c1a commit da42f7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/examples/full.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EGS, EGSUnitInfo } from "../zatca/egs";
22
import { ZATCASimplifiedInvoiceLineItem } from "../zatca/templates/simplified_tax_invoice_template";
33
import { ZATCASimplifiedTaxInvoice } from "../zatca/ZATCASimplifiedTaxInvoice";
4-
4+
import { generatePhaseOneQR } from "../zatca/qr";
55

66
// Sample line item
77
const line_item: ZATCASimplifiedInvoiceLineItem = {
@@ -59,6 +59,7 @@ const invoice = new ZATCASimplifiedTaxInvoice({
5959

6060
const main = async () => {
6161
try {
62+
6263
// Init a new EGS
6364
const egs = new EGS(egsunit);
6465

@@ -69,7 +70,7 @@ const main = async () => {
6970
const compliance_request_id = await egs.issueComplianceCertificate("123345");
7071

7172
// Sign invoice
72-
const {signed_invoice_string, invoice_hash} = egs.signInvoice(invoice);
73+
const {signed_invoice_string, invoice_hash, qr} = egs.signInvoice(invoice);
7374

7475
// Check invoice compliance
7576
console.log( await egs.checkInvoiceCompliance(signed_invoice_string, invoice_hash) );
@@ -81,6 +82,7 @@ const main = async () => {
8182
// Note: This request currently fails because ZATCA sandbox returns a constant fake production certificate
8283
console.log( await egs.reportInvoice(signed_invoice_string, invoice_hash) );
8384

85+
8486
} catch (error: any) {
8587
console.log(error.message ?? error);
8688
}

0 commit comments

Comments
 (0)