# Configure the Payments File with QR Code

This guide provides instructions to configure the payments file with QR Code.

## Prerequisites

* The user must have Program Administrator role.
* The user must have access to Program module in Open G2P systems.

## Procedure

1. Click the main menu icon ![](https://content.gitbook.com/content/JZcdob2emEcLMvLyIxqT/blobs/8OB4tqV7ZFODV0mhFdjA/image.png) and select ***Programs***.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2F03JpMIBLvwIz4tiZmLxn%2Fimage.png?alt=media&#x26;token=d380eafe-4eef-47da-8194-5a20d116d578" alt=""><figcaption></figcaption></figure>

***Programs*** screen is displayed.

2. Click the ***Configuration*** in the menu bar and then select ***Payments File Configs***.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FtTMCLQ4phqgfzTQqjQkU%2Fprograms-file-configs.png?alt=media&#x26;token=d6b8f95b-bae8-431b-8c5e-c1daa2bcd8c9" alt=""><figcaption></figcaption></figure>

***Payments File Configs*** screen is displayed.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2F3aVPlOOLLeuHGMW2CBNB%2Fprograms-file-configs-screen.png?alt=media&#x26;token=eebf858d-080c-4683-ae36-b08d8d06bf80" alt=""><figcaption></figcaption></figure>

3. Click the ***Create*** button.

***Payments File Configs /New*** screen is displayed.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FgVA1ICuBFQGzm31BAZp7%2Fprograms-file-configs-new-screen.png?alt=media&#x26;token=49b8bb55-f997-43f1-8d93-edea7072f9a4" alt=""><figcaption></figcaption></figure>

The fields and their descriptions are given below:

| Field    | Description                                                                                                                |
| -------- | -------------------------------------------------------------------------------------------------------------------------- |
| Name     | Enter the name for the payments file configuration                                                                         |
| Type     | <p>Select the format for the payments file from the drop-down. The valid values are: </p><ul><li>PDF</li><li>CSV</li></ul> |
| Template | Click the template tab to add the template of the payments file                                                            |
| QR Codes | Click the QR codes to configure the QR codes in the payments file                                                          |

### Configure QR codes in payments file

4. Click the ***QR Codes*** tab and click the ***Add a line*** link.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2F9EKeVNvVYaUHTlfOJLVb%2Fprograms-file-configs-fill-screen.png?alt=media&#x26;token=b6574c44-34d7-46b5-9d98-111cd8805b43" alt=""><figcaption></figcaption></figure>

***Create Qrcode Config*** screen is displayed.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FqWyXVV0CqifiX70LcwkV%2Fcreate-qrcodes.png?alt=media&#x26;token=e1e06ad8-baf7-4450-8965-2661182e822e" alt=""><figcaption></figcaption></figure>

The fields and their descriptions are given below:

| Field                | Description                                                                                                                                                                                                                                    |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name                 | Enter the name for the QR code                                                                                                                                                                                                                 |
| Type                 | <p>Select the appropriate option from the drop-down. The available options are: </p><ul><li>QR code</li><li>Code 128 Barcode</li></ul>                                                                                                         |
| Data Type            | <p>Select the appropriate option from the drop-down. The available options are: </p><ul><li>String</li><li>JSON</li><li>JWT</li></ul>                                                                                                          |
| Body                 | Fill the body based on the selected datatype                                                                                                                                                                                                   |
| Qrcode Version       | Enter the Qrcode version, if required. It is an optional field.                                                                                                                                                                                |
| Qrcode Error Correct | <p></p><p>Select the appropriate option from the drop-down. The available options are: </p><ul><li>ERROR\_CORRECT\_M </li><li>ERROR\_CORRECT\_L </li><li>ERROR\_CORRECT\_H</li><li> ERROR\_CORRECT\_Q</li></ul><p>It is an optional field.</p> |
| Qrcode Box Size      | Enter the size of the Qrcode box. Default size is 10. It is an optional field.                                                                                                                                                                 |
| Qrcode Border        | Enter the number of border for the Qrcode. Default border count is 4. It is an optional field.                                                                                                                                                 |

Based on the requirement you can configure QR code with different data types.

* Configure QR code with the data type - string
* Configure QR code with the data type - JSON
* Configure QR code with the data type - JWT

{% tabs %}
{% tab title="String" %}

#### Configure QR code with data type - string

1. Select the ***String*** from the data type drop-down.

If you want to configure QR code with minimum values, then select the data type as string (i.e., a  normal string to display inside the QR code). For example, the Qr codes may contain any one of the values like beneficiary ID, national ID, URL and so on.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2F3yLXiXGa88UvQgQRgMG7%2Fcreate-qrcodes-string.png?alt=media&#x26;token=09254e3b-ccc8-4936-b4a5-47e29d280522" alt=""><figcaption></figcaption></figure>

2. Click the ***Save & Close*** button to save Qrcode configuration.
3. Click the ***Discard*** button to exit from the screen.
4. Click the ***Save & New*** button to save and to create new Qrcode configuration.

The created Qrcode Config is displayed in the QR Codes list.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FN8qVL2YfRp7eVV21SZPz%2Fqrcodes-list.png?alt=media&#x26;token=b5e1ae2c-f97b-4e14-99bc-074d62913d4c" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="JSON" %}

#### Configure QR code with data type -  JSON

1. Select the ***JSON*** from the data type drop-down.

If you want to configure a QR code with more data, then select the data type as JSON (i.e.,  more data to display inside the QR code). For example, the QR code may contain data like issuer, subject, audience, expiry, amount, type, code, beneficiary name, service provider name, and so on.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FFsDl5FdKpj3MVGAgAxeH%2Fcreate-qrcodes-JSON.png?alt=media&#x26;token=81f53b28-fd5a-491a-a563-c3303bbd90c3" alt=""><figcaption></figcaption></figure>

2. Click the ***Save & Close*** button to save Qrcode configuration.
3. Click the ***Discard*** button to exit from the screen.
4. Click the ***Save & New*** button to save and to create new Qrcode configuration.

The created Qrcode Config is displayed in the QR Codes list.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FP6c1xJFGbWUQ4lDFbYg4%2Fqrcodes-list-JSON.png?alt=media&#x26;token=101a56fb-0750-45df-b382-60cfef7b2f02" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="JWT" %}

#### Configure QR code with data type -  JWT

1. Select the ***JWT*** from the data type drop-down.

If you want to configure a QR code with a digitally signed JSON data, select the data type as JWT (i.e., digitally signed JSON data to display inside the QR code). For example, the QR code may contain digitally signed JSON data like issuer, subject, audience, expiry, amount, type, code, beneficiary name, service provider name, and so on.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FYa0LWAAIzBSxrtraoiJA%2Fcreate-qrcodes-JWT.png?alt=media&#x26;token=14b89538-05c7-4d3c-854b-e50fb055a335" alt=""><figcaption></figcaption></figure>

2. Click the ***Save & Close*** button to save the Qrcode configuration.
3. Click the ***Discard*** button to exit from the screen.
4. Click the ***Save & New*** button to save and to create new Qrcode configuration.

The created Qrcode Config is displayed in the QR Codes list.

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2Fb7vFgg1y47Aa49f4npGl%2Fqrcodes-list-JWT.png?alt=media&#x26;token=d985ca2f-542e-4b9e-a83c-35b4c76576cb" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Render QR codes

After you configured the QR code, you must render QR codes in the template.

* Click the ***Template*** tab.

It displays the html code. Template contains the html code which defines the appearance of the files in PDF format.&#x20;

In the html code, search for the image source and update the QR code name that must appear in pdf format. For example&#x20;

\<img style="height:1.75in;width:1.75in;" t-att-src="object.qrcode\_ids.get\_by\_name('***\<QR code name>***').content\_htmlsafe"/>.

**Sample file with QR code**

<figure><img src="https://3034178245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJZcdob2emEcLMvLyIxqT%2Fuploads%2FxfcCg7rX0cGu6oXDCzOj%2Fvoucher.png?alt=media&#x26;token=03645476-119b-455c-8cf2-5f9023763bb3" alt=""><figcaption></figcaption></figure>
