# aforms

## General Information

aforms is a company specializing in the creation and management of digital forms for e-government and e-business applications. With the AFS software, public authorities and businesses can create multilingual, accessible, and standards-compliant forms without any programming knowledge – whether online, on mobile devices, or in PDF format.

### Links

* aforms [Website](https://www.aforms.com/)
* [Form creation](https://www.aforms.com/en/produkte/designer-formserver) with aforms

## Integration

The following guide outlines how to integrate Payrexx into the AFS Designer by aforms solutions & services.

{% hint style="info" %}
Please note that integration with aforms is only available in the Standard and Premium plans. [For more information](https://payrexx.com/en/prices)
{% endhint %}

### Configuration of Payrexx

{% hint style="info" %}
Make sure you're [logged in](https://login.payrexx.com/) to your Payrexx account before you begin. If you don’t have a Payrexx account yet, you can [register](https://signup.payrexx.com/) now.
{% endhint %}

* Navigate to the **API and Plugins** section in the main menu of your merchant administration.
* Scroll down to "Add API Integration" and click on "Add API Key":

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FLfUU9QFxnJZbvhxEJ0mE%2Fimage.png?alt=media&#x26;token=f93dfa8b-e9ab-4d3f-81e7-c7b4b7486099" alt=""><figcaption><p>Adding an API Key for integration with aforms</p></figcaption></figure></div>

* Give the integration any name you prefer, such as "aforms".
* Click on "Add":

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FLrvazqtqPxl01xSjSVmr%2Fimage.png?alt=media&#x26;token=5873271b-6a36-4b74-a340-3af4eb484cd1" alt="" width="563"><figcaption><p>Click on "Add" to generate the API Key</p></figcaption></figure></div>

* You will now find the new API Key under "Active Integrations."
* Click on "Copy" to copy the API Key to your clipboard. You will need it in a later step:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FWeZ0JV7wpeDArKALpdWT%2Fimage.png?alt=media&#x26;token=07d814f6-ca61-49b7-bb45-0e025277a260" alt=""><figcaption><p>Copying the API key to the clipboard for later use with aforms</p></figcaption></figure></div>

### Configuration of aforms

#### Form server property

* In the AFS Designer, navigate to **Administration > Resources**:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2F05aNsf4bYJ8pBX1Y20Gv%2Fimage.png?alt=media&#x26;token=86618ebb-5fdc-4cac-8955-4bdfbc418a21" alt=""><figcaption><p>Starting the configuration in the AFS Designer</p></figcaption></figure></div>

* Search the resource list for a form server property or create a new one using the plus icon:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FJJb16Y0AJW3Rt5KauPbJ%2Fimage.png?alt=media&#x26;token=b1f22cf8-3c0b-4838-acac-8d999a552f09" alt=""><figcaption><p>Creating a form server property</p></figcaption></figure></div>

* Enter your properties and save with the check mark icon:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FuMHqqgwsfHRQ6pyMWQuo%2Fimage.png?alt=media&#x26;token=63412cde-388e-43a1-8e22-5f74bfb37566" alt=""><figcaption><p>Entering the properties</p></figcaption></figure></div>

Examples Formserver Property:

```
# Payrexx-URLcom.anecon.afs.common.extender.payrexx.url=
```

First part (up to the first dot) of the Payrexx administration URL:

```
https://aforms2web.payment...com.anecon.afs.common.extender.payrexx.instanceId=xxx
```

Default API key from the Payrexx administration:

```
com.anecon.afs.common.extender.payrexx.secret=xxx
```

{% hint style="info" %}
Replace 'xxx' with the API Key that you copied to your clipboard during the Payrexx configuration.
{% endhint %}

Currency:

```
com.anecon.afs.common.extender.payrexx.currency=xxx
```

#### Form, page, and block

* Navigate to **Forms** and create a new form using the plus icon:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FhFxgZWWOZrVNOUxivnev%2Fimage.png?alt=media&#x26;token=0c84ede2-9874-456d-a0a1-092099ec6c75" alt=""><figcaption><p>Creating a new form</p></figcaption></figure></div>

* Enter the form name, the general ID, and the description of the form:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FIuiHymickDs4srSFSWei%2Fimage.png?alt=media&#x26;token=593b4e28-2588-4dfb-ba4c-6e8a977488f0" alt=""><figcaption><p>Form configuration</p></figcaption></figure></div>

* Create a new form page, fill in the corresponding fields, and save your settings:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2F0LYcc5IQeSPa4XEhrWpF%2Fimage.png?alt=media&#x26;token=183afff4-220f-4062-b562-3c3519b5d109" alt=""><figcaption><p>Configuration of the new form page</p></figcaption></figure></div>

* Create a new block within the created form page:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FvMmTEDAU1azLhwWz7BzI%2Fimage.png?alt=media&#x26;token=11de2744-3773-48f8-84de-78ec79cab270" alt=""><figcaption><p>Creating a new block</p></figcaption></figure></div>

* Add the required fields to the newly created block:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FIRoeN4y0PcinaYATeL9R%2Fimage.png?alt=media&#x26;token=74e3454e-dcc1-4737-a03d-5fdfab7fa459" alt=""><figcaption><p>Block configuration</p></figcaption></figure></div>

* Automatically create the layout of the block by clicking the table icon, define the field names and placeholder texts for the layout, and save the block:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FOpRljqLZRGh5ty2gfvWb%2Fimage.png?alt=media&#x26;token=ec7d9a61-dc30-4420-b315-1b25f43b3c84" alt=""><figcaption><p>Creating the layout for the block</p></figcaption></figure></div>

* This is what the created block looks like:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FHwnnfiwiPyrx5RJlsiIA%2Fimage.png?alt=media&#x26;token=69ab82f5-fce7-463e-9051-43a1e0e1a5f5" alt=""><figcaption><p>Displaying the block</p></figcaption></figure></div>

* Place the newly created block on the first page of the form:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2F0PZbBenwoXVEsSrfJEoK%2Fimage.png?alt=media&#x26;token=e9346f15-c1c1-45ec-bc6e-100736fc485d" alt=""><figcaption><p>Placing the block</p></figcaption></figure></div>

* Save the page and form details by clicking the check mark icon. Form, page, and block are now ready for integration with Payrexx.

#### Creating and configuring the extender

{% hint style="info" %}
With the Payrexx extender, you can offer form users the option to make a payment directly upon submission. Communication between AFS and Payrexx takes place via REST web services. This function is available at the form level.
{% endhint %}

* Create a new extender at the form level by clicking the plus icon:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FxrMXyIcxRguA6iqrRnye%2Fimage.png?alt=media&#x26;token=85875304-94ba-456c-b415-ee4484d4ff0e" alt=""><figcaption><p>Creating an extender</p></figcaption></figure></div>

* Select the "Form: Payrexx" option from the extender selection list:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FkyWnwlinJJbOGfJas4SK%2Fimage.png?alt=media&#x26;token=679df4d6-4db5-4d90-aee4-882d3e6a6969" alt=""><figcaption><p>Creating an extender of type "Form: Payrexx"</p></figcaption></figure></div>

* Configure the extender according to your requirements and save it by clicking the check mark icon:

<figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FNEV9CciwLszfgX1OIH2j%2Fimage.png?alt=media&#x26;token=8c9b733b-f92a-49d7-b7d5-eb9f1a84117d" alt=""><figcaption><p>Extender configuration</p></figcaption></figure>

* Using the condition =#V1=="1" (SpeL expression), the extender will only be executed if the payment method "Credit Card" has been selected in the form:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FnR0quY3QFowcQabBkDLU%2Fimage.png?alt=media&#x26;token=62390be0-ef29-4642-b02d-c98cd12aa256" alt=""><figcaption><p>Restricting extender execution to payment method "credit card"</p></figcaption></figure></div>

* This is what the payment method selection looks like in the form:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FkVDASSPhdl96f9axP0iN%2Fimage.png?alt=media&#x26;token=afc72500-be35-4b1b-bd27-4204053cbfa0" alt="" width="239"><figcaption><p>Payment method selection</p></figcaption></figure></div>

{% hint style="info" %}
Kindly note that the purchase on invoice payment method will always be shown.
{% endhint %}

* Fields can be assigned to the extender via the form tree:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2FowhzZIjkxEYLdze3h5MI%2Fimage.png?alt=media&#x26;token=ef48924f-8d4f-4a2e-b90e-25e39079fc78" alt=""><figcaption><p>Field assignment in the extender</p></figcaption></figure></div>

**Usage of the Fields:**

* **Payment Note:** The payment note consists of the reference ID and the form title and is used to identify the payment in the Inbox/APF.
* **Reference ID:** The reference ID is a unique ID used to identify the payment.
* **Amount:** Transaction amount
* **First Name:** First name of the applicant
* **Last Name**: Last name of the applicant
* **Email Address for Payment Confirmation:** The invoice and payment confirmation will be sent to this email address.

**Purpose of Use in the Invoice (Product Description):**

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2Feh260JqniFjNoqX6DH2z%2Fimage.png?alt=media&#x26;token=9c14995e-5edd-43ec-b616-3ae6a6492faf" alt=""><figcaption><p>Invoice with purpose of use (product description)</p></figcaption></figure></div>

#### Transfer form collection

* By clicking the arrow icon, the form collection is transmitted to the form server and thus made available online:

<div align="left"><figure><img src="https://1455115231-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MYJhU4qriZCz_Wxs0T0-887967055%2Fuploads%2Fqyz2Qd25Ov5CKq8v2ZPJ%2Fimage.png?alt=media&#x26;token=361cec88-f095-4c50-b3a5-0282f6c952b4" alt=""><figcaption><p>Transmitting the form collection to the form server</p></figcaption></figure></div>
