PakDataKit - v2.2.0
    Preparing search index...

    Function validateRaastQr

    • Checks whether a Raast QR code can be paid, e.g. before showing a payment screen or to warn about a tampered sticker.

      Errors: not a Pakistani payment QR, checksum mismatch (damaged or edited), no IBAN or an IBAN that fails its checksum, expired, or a fixed-amount QR without the expiry that banking apps require. Warnings: an amount in a static QR (apps ignore it, so the payer must type it), or a QR that expires soon (within an hour by default).

      Parameters

      • payload: string

        Text decoded from the QR code

      • options: ValidateRaastQrOptions = {}

        Time to check against and the "expires soon" window

      Returns RaastQrValidation

      Validation result with the parsed QR

      validateRaastQr(scannedText);
      // { valid: false, errors: ['expired'], warnings: [], qr: { ... } }