# Magento 2

{% hint style="info" %}
Available for Magento 2.4 - 2.4.x
{% endhint %}

## General Information

Magento 2 is an open-source e-commerce platform developed by Adobe for creating online shops. With a dedicated plugin, the Payrexx payment solution can be integrated into Magento 2.

The plugin is also compatible with the Magento Community Edition (Open Source).

### Links

* Magento 2 [Website](https://business.adobe.com/uk/products/magento/open-source.html)
* Plugin [Download](https://github.com/payrexx/magento-payrexx-gateway)

### Features

* ✅ Multi-currency support
* ✅ Payment method logos displayed at checkout
* ✅ Shopping cart data transfer
* ✅ Webhook Compatibility
* ✅ Custom configuration of payment methods
* ✅ [Hyvä Checkout Module](https://github.com/payrexx/hyva-payrexx-compatibility) Compatibility
* ❌ Look & Feel Customization Options
* ❌ Subscription Support

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

### Payment methods

The following payment methods are supported by the Magento 2 plugin:

<table><thead><tr><th width="206.74072265625">Payrexx Pay</th><th width="244.1112060546875">Payrexx Pay Plus</th><th width="197.5555419921875">External Payment Providers</th><th data-hidden></th></tr></thead><tbody><tr><td><img src="/files/WJVwKt7DxusvjH585W5R" alt="" data-size="line"> <a href="/pages/8yNTcYg81Qwv7VREKUIF">Mastercard</a></td><td><img src="/files/WJVwKt7DxusvjH585W5R" alt="" data-size="line"> <a href="/pages/8yNTcYg81Qwv7VREKUIF">Mastercard</a></td><td><img src="/files/78nPVauXSM5j8W1hf2DW" alt="" data-size="line"> Masterpass</td><td></td></tr><tr><td><img src="/files/8rrzZlphAr7Za4U5vnxE" alt="" data-size="line"> <a href="/pages/LdCqbL0vrX4CRIRpSXYN">Visa</a></td><td><img src="/files/8rrzZlphAr7Za4U5vnxE" alt="" data-size="line"> <a href="/pages/LdCqbL0vrX4CRIRpSXYN">Visa</a></td><td><img src="/files/Px5ih1Yy9TMEgVNjJr6C" alt="" data-size="line"> <a href="/pages/-M_fCRvhjSe_xp0bVopO">PayPal</a></td><td></td></tr><tr><td><img src="/files/O1IcwrLg6vHPIFMW71OG" alt="" data-size="line"> <a href="/pages/tn2AEjEp1riYNXRufL3w">PostFinance Pay</a></td><td><img src="/files/x9QwkL0vhKacPC1FbAdX" alt="" data-size="line"> <a href="/pages/CULvEQ5MyGPCgQil0NFP">American Express</a></td><td><img src="/files/qZPAwCRYFyVy7PuTqLyb" alt="" data-size="line"> Maestro</td><td></td></tr><tr><td><img src="/files/F5MKlDmJfiQrjosXATyg" alt="" data-size="line"> <a href="/pages/48Bh9N8bXYOSanBPFV7F">TWINT</a></td><td><img src="/files/KyMObC4NB9XLN5w6nG3b" alt="" data-size="line"> <a href="/pages/0j82hYUlcHfgEoAzqYtM">Diners Club International</a></td><td><img src="/files/187zwnGlPInPLD7hT3fM" alt="" data-size="line"> HeyLight</td><td></td></tr><tr><td><img src="/files/cFJ49Ye7t0qo7I5osWrP" alt="" data-size="line"> <a href="/pages/RippLLnzVKQ18a5NnxTV">Google Pay</a></td><td><img src="/files/hWsNhEecDhAgfFSuqIwO" alt="" data-size="line"> <a href="/pages/9ED8SqGhxqa26m8fKTxC">Discover Card</a></td><td><img src="/files/2ZameCpQlezKSA4Qsd5a" alt="" data-size="line"> Swissbilling</td><td></td></tr><tr><td><img src="/files/9nOxIIDiwvvsQ0Eo5PoP" alt="" data-size="line"> <a href="/pages/yv61YCASPtUr49LnyrdP">Pay by Bank</a></td><td><img src="/files/oiHWgGVc4TXGx4I8A8FH" alt="" data-size="line"> <a href="/pages/qCkdWJg4Wrb6mGvgzgYL">Apple Pay</a></td><td><img src="/files/5akObsEJqWhUzdE9kuI8" alt="" data-size="line"> <a href="/pages/-M_uAXq3bMxkY9FacLyn">WIRpay</a></td><td></td></tr><tr><td><img src="/files/ZwwNMSVMl4Jh1fzAbmdA" alt="" data-size="line"> <a href="/pages/wwepYXQqxU940JaurJxX">Purchase on Invoice</a></td><td><img src="/files/cFJ49Ye7t0qo7I5osWrP" alt="" data-size="line"> <a href="/pages/RippLLnzVKQ18a5NnxTV">Google Pay</a></td><td> <img src="/files/86ZkIaXn72MK8od3KeRX" alt="" data-size="line"> <a href="/pages/-Ma2IVH0tr0RPF2SgSVP">Barzahlen/viacash</a></td><td></td></tr><tr><td><img src="/files/wGozkDtDq52GpO78HKq1" alt="" data-size="line"> <a href="/pages/tXnCsIfUNpmTnnmpAmH0">Centi</a></td><td><img src="/files/5tUKnraMZivl4tDWvGfp" alt="" data-size="line"> <a href="/pages/93LqVe7o6JNKTfcqNvgm">Klarna</a></td><td><img src="/files/I2eINBnlQvxy9YMUhybE" alt="" data-size="line"><a href="/pages/-M_u_Bhz7NXU90kfAanO">giropay</a></td><td></td></tr><tr><td><img src="/files/0qXmTTtejLWoCYW0xLH7" alt="" data-size="line"> <a href="/pages/RjyJlgsomeU324sQATMF">Crypto</a></td><td><img src="/files/x8hhJaY6YXCjvJxz9gMB" alt="" data-size="line"> <a href="/pages/Ft2eQ2bS5se2ZgHp3Zfd">eps</a></td><td><img src="/files/b98rHdQTVI0h3I1nAC79" alt="" data-size="line"> JCB</td><td></td></tr><tr><td></td><td><img src="/files/ehTj9YXkXTkDAnmVtcFq" alt="" data-size="line"> <a href="/pages/k7PfSWvskK5ek1fIw1P8">Bancontact</a></td><td><img src="/files/w2hYB6OtrE63bPCPJ6JY" alt="" data-size="line"> <a href="/pages/-Ma2ITlSkH8zz-uuVtW-">Paysafecash</a></td><td></td></tr><tr><td></td><td><img src="/files/NYrAa7TQDAYmJEKhf4Vq" alt="" data-size="line"> <a href="/pages/V2h1I5IYOFxzLDjRj95q">iDEAL</a></td><td><img src="/files/bXm8uob0fSJl5ilCPJKx" alt="" data-size="line"> Bitcoin</td><td></td></tr><tr><td></td><td> <img src="/files/ixIWzbQbyqhDqmofw9W7" alt="" data-size="line"> <a href="/pages/OyGj6W51V9vAYZ6jBBUE">SEPA Debit Direct</a></td><td> <img src="/files/Y6Vg3EOODHSpYyKWW4Py" alt="" data-size="line"> <a href="/pages/Qs5X0wxESiTK2FORZnb5">Bill</a></td><td></td></tr><tr><td></td><td></td><td><img src="/files/ur1Ki5bMiba6JtwhhPzx" alt="" data-size="line"> <a href="/pages/a9v9YNRbLeYm4y3XNpY9">POWERPAY</a></td><td></td></tr><tr><td></td><td></td><td><img src="/files/5HxCEkCzSYKmAjuumh81" alt="" data-size="line"> <a href="/pages/cmtHpDGTSBHLtCHkdhHa">CembraPay</a></td><td></td></tr><tr><td></td><td></td><td> <img src="/files/ti7V8srnwwwBhZKsS1qp" alt="" data-size="line"> <a href="/pages/wVvqPzh7NBzisgACLNBf">VERD</a></td><td></td></tr></tbody></table>

## Integration

Follow the instructions below to integrate Payrexx into Magento 2.

### 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 %}

* In the merchant administration area of your Payrexx account, navigate to **API & Plugins**.
* Click "Show all" under "Add E-Commerce Integration".
* Next to Magento 2, click "Add".

<div align="left"><figure><img src="/files/nkAaCZraeJWXXFxrwGFc" alt=""><figcaption><p>Start of Magento 2 integration</p></figcaption></figure></div>

* In the window that appears below, configure the following settings:

<div align="left"><figure><img src="/files/hCH4Q6nWqGF8kbhryTQV" alt=""><figcaption></figcaption></figure></div>

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

{% hint style="warning" %}
Please ensure that the shop URL is entered correctly. Any discrepancies (e.g. using http\:// instead of https\://) may cause errors when processing webhooks.
{% endhint %}

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

### Plugin installation

* Download the latest version of the [plugin](https://github.com/payrexx/magento-payrexx-gateway) from GitHub.
* Open the **/app/** directory located in the root directory of your Magento installation.
* Inside the **/app/** directory, create the following folder structure:\
  **code/Payrexx/PaymentGateway/**
* Extract the downloaded ZIP file into the **/PaymentGateway** directory.
* Move all extracted files and folders into the **/PaymentGateway** directory.

### Activating the extension

* Log in to the Magento 2 admin panel.
* Navigate to the root directory of your Magento 2 installation and execute the following commands:

`$ bin/magento setup:upgrade`

`$ bin/magento setup:di:compile`

`$ bin/magento cache:clean`

{% hint style="warning" %}
This process may take some time to complete.
{% endhint %}

{% hint style="info" %}
For Magento versions older than 2.3, the extension can alternatively be activated via\
**System > Web Setup Wizard**. Further details can be found in the installation guide on GitHub.
{% endhint %}

### Configuration of Magento 2

* In the Magento 2 admin panel, navigate to **Stores > Configuration > Sales > Payment Methods**.
* Scroll down to the section "Other Payment Methods" and click the expand triangle icon.
* Open the section "Required Settings" and enter the values that were previously copied to your clipboard during the [Payrexx configuration](#configuration-of-payrexx):

<div align="left"><figure><img src="/files/6kupPwanRsmSsJ2WgJOV" alt=""><figcaption><p>Settings in Magento 2</p></figcaption></figure></div>

1. **Instance Name:** Enter the instance name provided by Payrexx.
2. **API Secret Key:** Enter the API key obtained from your Payrexx account.

{% hint style="info" %}
Alternatively, the connection can be established just as easily by clicking the "Connect" button.
{% endhint %}

{% hint style="success" %}
The configuration is complete. Your customers can now make payments in your Magento 2 shop using the payment methods provided by Payrexx.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payrexx.com/merchant/english/integration/e-commerce/magento-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
