ZatcaManager class
A singleton class that manages the generation of ZATCA-compliant invoices and QR codes.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
generateUBLXml(
{required String invoiceHash, required String signingTime, required String digitalSignature, required String invoiceXmlString, required String qrString}) → String -
generateZatcaQrInit(
{required BaseInvoice invoice}) → ZatcaQr -
/// Generates a ZATCA-compliant QR code and invoice data.
///
invoiceLines- The list of invoice lines. ///invoiceType- The type of the invoice. ///invoiceRelationType- The relation type of the invoice (default isb2c). /// customer - The customer information (required forb2binvoices). ///issueDate- The issue date of the invoice. ///invoiceUUid- The unique identifier for the invoice. ///invoiceNumber- The invoice number. ///issueTime- The issue time of the invoice. ///totalWithVat- The total amount including VAT. ///totalVat- The total VAT amount. ///previousInvoiceHash- The hash of the previous invoice. /// Returns aZatcaQrobject containing the QR code and invoice data. -
getQrString(
ZatcaQr qrDataModel) → String -
Generates a QR code string from the given
ZatcaQrdata model. -
initializeZacta(
{required String privateKeyPem, required String certificatePem, required Supplier supplier, required String sellerName, required String sellerTRN}) → dynamic -
Initializes the ZATCA manager with the required supplier and cryptographic details.
supplier- The supplier information.privateKeyPem- The private key in Base64 format.certificatePem- (CSR) The certificate request in Base64 format.sellerName- The name of the seller.sellerTRN- The Tax Registration Number (TRN) of the seller.issuedCertificateBase64- The issued certificate from zatca compliance. only required for generating UBL standard XML -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHex(
Uint8List data) → String -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ ZatcaManager
-
The single instance of the
ZatcaManagerclass.getter/setter pair