File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import { EGS , EGSUnitInfo } from "../zatca/egs" ;
22import { ZATCASimplifiedInvoiceLineItem } from "../zatca/templates/simplified_tax_invoice_template" ;
33import { ZATCASimplifiedTaxInvoice } from "../zatca/ZATCASimplifiedTaxInvoice" ;
4-
4+ import { generatePhaseOneQR } from "../zatca/qr" ;
55
66// Sample line item
77const line_item : ZATCASimplifiedInvoiceLineItem = {
@@ -59,6 +59,7 @@ const invoice = new ZATCASimplifiedTaxInvoice({
5959
6060const 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 }
You can’t perform that action at this time.
0 commit comments