Magento 2 / Adobe Commerce | Create OCI and cXML PunchOut Catalogues | PunchCommerce                           ![](//analytics.punchcommerce.de/matomo.php?idsite=1&rec=1)

Magento 2 / Adobe Commerce
==========================

Our free extension for Magento 2 allows you to use our OCI or cXML Gateway PunchOut in conjunction with your Magento online shop. In this scenario, we take over the communication with your customer or their system (Ariba, Oracle or SAP) and forward the customer to your online shop after successful authentication.

### Setting up the Gateway PunchOut

Download the latest version of the extension and install it in your Magento 2 online shop. You can find the current version of our module [here](/en/downloads)

#### Setup in PunchCommerce

1. create a new customer and select OCI or cXML Gateway as the mode
2. finalise the configuration of the customer in PunchCommerce by configuring the entry address (in your online shop) including the placeholders {{uID}} and {{sID}} and the customer ID

***Note** Configure the URL of your online shop as the entry address according to the following scheme:*

```
https://../punchcommerce/authenticate/index/?sId={{sID}}&uId={{uID}}
```

#### Installation in Magento 2

![](https://www.punchcommerce.de/storage/media/support-articles/magento-2/plugin-configuration.png)

The module can be installed in two different ways:

- **Variant 1:** Place the module in a path repository for composer and execute the following command: ```composer require ecentral/module-punchcommerce````
- **Variant 2:** Copy the module files into the directory ```./app/code/Ecentral/PunchCommerce````

In the next step, you must execute the following commands, regardless of which of the two variants you have selected:

```
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
```

#### Configuration in Magento 2

![](https://www.punchcommerce.de/storage/media/support-articles/magento-2/customer-configuration.png)

1. create a Magento customer and define a PunchCommerce ID in the "PunchCommerce customer ID" attribute.
2. activate the module under "Stores &gt; Configuration &gt; PunchCommerce &gt; PunchCommerce settings"
3. specify whether the user should be asked whether the shopping basket should be forcibly emptied before refreshing the session
4. to execute the Punchout in an iFrame, you must set the "Frame Ancestor" configuration field to the domain that provides the iFrame. You can define several domains separated by spaces.

5. Customise the product assignment. The corresponding documentation can also be found below the configuration field in the Magento backend.

6. **Optional** Set the hook URL to point to your PunchCommerce Server instance. You only need to adjust this value if you are a PunchCommerce Enterprise user.

**Example configuration field mapping in Magento**

```
{
  "field1": {
    "type":
    "target":
    "value":
  },
  "field2": {
    ...
  },
  ...
}
// Must contain definitions for fields: brand, price, tax_rate, purchase_unit, packaging_unit, shipping_time
```

### Adjustments to your web server

As your online shop is usually displayed as an iFrame within your customer's e-procurement application with a PunchOut, the web server configuration needs to be adapted.

\*\*Apache

It is necessary to remove or comment line 289 in the pub/.htaccess file:

```
Header set X-Frame-Options SAMEORIGIN
```

This line prevents the website from being loaded in iFrames.

**Note:** Make sure that this change does not create any security risks. It may be necessary to strengthen other security measures to maintain protection against clickjacking attacks.

**Nginx**

The following line could also prevent the website from loading in iFrames:

```
add_header X-Frame-Options "SAMEORIGIN";
```

**Note:** As this configuration has not yet been tested, it is recommended to perform tests to ensure that no functionality of the website is affected. It may be necessary to adjust the configuration or take alternative security measures.

 [ PunchCommerce® ist ein Produkt der ![Netzdirektion GmbH](https://www.punchcommerce.de/static/netzdirektion-logo.png "PunchCommerce® ist ein Produkt der netzdirektion | Gesellschaft für digitale Wertarbeit mbH") ](https://netzdirektion.de)

 [Give feedback now - your opinion helps us to become even better!](https://easy-feedback.de/umfrage/1883200/5FuM95 "Your opinion helps us to become even better!")
