# Drupal

{% hint style="info" %}
Available for Drupal 9.x and 10.x
{% endhint %}

## General Information

Drupal is a modular open-source content management system (CMS) that allows businesses to create and manage websites. Through the integration of Payrexx into Drupal, merchants can accept payments from their customers directly in their online store.

### Links

* Drupal [Website](https://new.drupal.org/home)
* Download the [Plugin](https://www.drupal.org/project/commerce_payrexx_integration/releases/2.0.1)
* Plugin [Installation Guide](https://www.drupal.org/project/commerce_payrexx_integration)

## Setup

Follow the instructions below to integrate Payrexx into Drupal.

{% hint style="info" %}
Please note that integration with Drupal 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, please [register](https://signup.payrexx.com/).
{% endhint %}

* In the merchant administration of your Payrexx account, navigate to **API & Plugin**s.
* Click "Show all" under "Add E-commerce integration".
* Click "Add" next to Drupal:

<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%2FH5lm9NUBQhvjhw8D3SaI%2Fimage.png?alt=media&#x26;token=81ca1297-c6e1-4c42-ad1a-e9c403158c11" alt=""><figcaption><p>Starting the integration of Payrexx and Drupal</p></figcaption></figure></div>

* In the window below, configure the following 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%2Fm5FHPHl9jyz1tITe4LQg%2Fimage.png?alt=media&#x26;token=93963a72-442e-4e77-8dd9-2aafbbf26593" alt=""><figcaption><p>Configuring the Payrexx integration for Drupal</p></figcaption></figure></div>

1. **API Key:** Copy the displayed API key to your clipboard — you will need it later.
2. **Instance Name:** Copy the displayed instance name to your clipboard — you will also need this later.
3. **Enter shop address:** Enter the URL of your shop in this field.\
   If your shop is not located in the root directory (e.g., <https://demo-shop.com>), but in a subdirectory, please enter the full path to your shop. Example: <https://demo-shop.com/shop>

{% hint style="warning" %}
Make sure the shop URL is entered correctly. Inconsistencies (e.g., using http\:// instead of https\://) may cause errors in webhook processing.
{% endhint %}

4. **Webhooks:** Define whether a failed webhook should be retried or not.\
   If the checkbox is enabled, the system will attempt to resend the webhook up to 10 times. Retry intervals are: 5 minutes, 15 minutes, 1 hour, 2 hours, 4 hours, and then every 24 hours thereafter.
5. **Finalize:** Click the green "Activate" button to complete the configuration.

### Plugin installation

* Install the module by running the following command:\
  `composer require drupal/commerce_payrexx_integration`
* Activate the module with the command:\
  `drush en commerce_payrexx_integration`

### Module configuration

* Create the payment gateway under `/admin/commerce/config/payment-gateways`
* Select "Payrexx (Redirect to Payrexx)" as the plugin.
* Fill in all required fields. Insert the values you previously copied during the Payrexx configuration into the corresponding fields:
  * Paste the instance name into the "Instance Name" field.
  * Paste the API key into the "Secret" field.

{% hint style="success" %}
The configuration is now complete. Your customers can now pay in your Drupal shop using the payment methods available via Payrexx.
{% endhint %}
