Magento 2 Module

Our free extension for Magento 2 allows you to use our OCI or cXML Gateway PunchOut in connection 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 store. You can find the current version of our module here.

Setup in PunchCommerce

  1. Create a new customer and select OCI or cXML gateway as the mode
  2. Complete the customer configuration in PunchCommerce by configuring the entry address (in your online shop) and the customer ID

Note As an entry address, configure the URL of your online shop according to the following scheme:

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

Installing in Magento 2

The module can be installed in two different ways:

  • Variant 1: Place the module in a path repository for composer and run 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, regardless of which of the two variants you have chosen, you must execute the following commands:

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

Configuration in Magento 2

  1. Create a Magento customer and set a PunchCommerce identifier in the PunchCommerce Customer ID attribute.
  2. Activate the module under "Stores > Configuration > PunchCommerce > PunchCommerce Settings"
  3. Set whether to ask the user before refreshing the session and whether to forcibly empty the shopping cart.
  4. To perform punchout in an iFrame, you must set the Frame Ancestor configuration field to the domain that provides the iFrame. You can set multiple domains separated by spaces. 5.Adjust product mapping. The associated documentation can also be found below the configuration field in the Magento backend.
  5. 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": <"map"(default. may be omitted) or "static">
     "target": <"product" or "item". Only used for type map. Sets product or quote item as mapping target>
     "value": <Literal value for type static or attribute code to be mapped from target>
   },
   "field2": {
     ...
   },
   ...
}
// Must contain definitions for fields: brand, price, tax_rate, purchase_unit, packaging_unit, shipping_time

Adjustments to your web server

Since with a PunchOut your online shop is usually displayed as an iFrame within your customer's e-procurement application, the web server configuration must be adjusted.

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 loading in iframes.

Note: Please ensure 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: Since this configuration has not yet been tested, it is recommended that you run tests to ensure that no website functionality is affected. It may be necessary to adjust the configuration or take alternative security measures.

PunchCommerce® ist ein Produkt der Netzdirektion GmbH