# validateRaastQr

Source: https://pakdatakit.dev/api/typescript/raast/functions/validateraastqr/

```ts
function validateRaastQr(payload, options?): RaastQrValidation;
```

Defined in: [raast.ts:548](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/raast.ts#L548)

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

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `payload` | `string` | Text decoded from the QR code |
| `options?` | [`ValidateRaastQrOptions`](https://pakdatakit.dev/api/typescript/raast/interfaces/validateraastqroptions/) | Time to check against and the "expires soon" window |

## Returns

[`RaastQrValidation`](https://pakdatakit.dev/api/typescript/raast/interfaces/raastqrvalidation/)

Validation result with the parsed QR

## Example

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