Magento 2
The Nexi XPay payment extension for Magento 2, allows you to integrate the XPay payment gateway without further implementation on your site.
Installation
The Nexi XPay plugin for Magento 2 is available for free on the website Adobe Commerce Marketplace, from which you will be able to check for compatible versions.
Installation via composer
Before proceeding, check that Composer is installed in your environment. Below is the list of commands to run for installation:
1. Install the plugin
2. Enable the plugin
3. Run the update command
4. Clear the cache
The installation phase is complete, proceed with the configuration.
Configuration
Here are the instructions to correctly configure the plugin:
- Log into the Magento administrative panel.
- In the navigation bar on the left select Stores (Stores) > Configuration (Configuration).
- In the new menu on the left select Sales (Sales) > Payment methods (Payment methods) > Nexi XPay.
- Proceed with the configuration of the module:
| Field | Description |
|---|---|
| Credential type | Select API Key |
| Integration type | - Hosted payment page with redirect: the customer is redirected to XPay's external payment page. - Build with embedded checkout: the card data entry form is integrated into the checkout. |
| API Key | Code required for communication with the XPay gateway. To obtain this data for the production or test environment, follow the instructions in the following paragraph Test and production. |
| Enabled | Enable the Nexi XPay payment module. |
| Enable TEST Mode | Enable or disable test mode. Test credentials can be found in the Test area section. |
| Enable OneClick | This feature allows you to tokenize the customer's card data in order to allow faster subsequent payments. Make sure that this option is also enabled on your terminal configuration. Not available for the integration type Build with embedded checkout. |
| Enable 3D secure 2 | The new 3D Secure 2 protocol adopted by the main international circuits (Visa, MasterCard, American Express), introduces new authentication methods, capable of improving and speeding up the cardholder's shopping experience. |
| Enable Multicurrency | Available only through payment cards: enable this option to allow payment via card in various currencies. For the full list of supported currencies, visit the Multicurrency payments section of the developer portal. Make sure that this option is also enabled on your terminal configuration. |
| Timeout Pay-By-Link | Maximum time in hours for which the Pay-By-Link link will be usable. |
| Enable installment payments | This feature is only available to merchants with a Greek VAT number. Enable this option to use installment payments via XPay. Before enabling this feature, please ensure it is available on your terminal through your payment service provider. |
| Sort order | Manages the position of the payment method on the checkout page relative to other payment methods |
Google Pay Configuration
Google Pay can be enabled in two modes:
- REDIRECT: default option automatically activated by Nexi on the plugin. Selecting this payment method redirects to an external XPay gateway intermediate page, from which it will be possible to pay with Google Pay. A Google Merchant account and the use of the Google Pay Business Console are not required.
- BUTTON: a native Google Pay button is created, allowing payment without redirection to external intermediate pages. Instructions for activating this mode:
- Enable APM: verify that the alternative payment method (APM) is enabled on the terminal by accessing the Nexi Business portal; in the XPay Back office section, select Alternative Payments > Google Pay.
- Register the domain: log in to the Google Pay Business Console and register the store domain (Google Pay API > Integrate with your website). Google must approve the site before you can proceed. If you do not have a Google Merchant account, create one during the procedure.
-
Enter merchant data: once the domain is approved, retrieve the following data from the Google Pay console:
- Google Merchant Name
- Google Merchant ID
- Set the Gateway Merchant ID: enter a unique code in this field; it is recommended to use an online UUID generator.
Field Description Google merchant name Data provided by Google in the Google Pay console. Google merchant Id Data provided by Google in the Google Pay console. Google gateway merchant Id Enter a unique code in this field; it is recommended to use an online UUID generator. Button type Google provides different styles for the Google Pay payment button. For more information and a preview of the different types, consult the Brand guidelines page. Button color Background color of the Google Pay button. For more information and a preview of the different types, consult the Brand guidelines page. Test and production
It is highly recommended that you test the plugin in a test environment, before entering the production code.
It is possible to obtain the test credentials (API key) in the test area. In the area there will also be test cards that can be used to carry out successful and negative transactions. In this phase it is necessary to verify that the orders are created correctly, also checking the details of the orders.
Switch to production
To carry out the transition to production it is necessary to create the production credentials (API Key). To generate the new credentials follow these steps:
- Log in to Nexi Business.
- Sign in to the XPay Web Back Office.
- In the "Admin" section click on "APIKey".
- Click on "Add new APIKey".
- Once the terminal has been selected, click on "Add" to generate the production API Key.
Once the API Key has been created, the module configuration must be updated:
- Log in to the Magento back office
- In the payment configuration section click on "Nexi"
- Disable the TEST mode and enter the API Key generated on Nexi Business
- Save the new configuration
It is advisable to carry out a proof of payment with a real card with the transition to production.
Payment methods
The Nexi XPay plugin offers customers various payment methods:
Payment by cards
With this solution, the customer remains on the merchant's e-commerce until checkout. It is redirected to the Nexi environment to make the payment and then return to the merchant's website at the end of the transaction.
OneClick Payment
Integrating this solution allows the end customer to store their credit card data and use it later to make purchases with just a few clicks.
In the case of the first payment, XPay will display the form for entering the card details. For subsequent payments, it will show the previously entered card information or provide the option to enter the details of a new card.
Not available for the integration type Build with embedded checkout.
Pay-By-Link
This solution involves generating an order on the Prestashop side, selecting the appropriate products and the customer who wishes to make the purchase.
By clicking on the button "Send an email to the customer with the link to make the payment" an email will be sent to the customer containing a link to make the payment. The customer will be redirected to the checkout page of the ecommerce site.
Alternative Payment Methods (APM)
The plugin offers several alternative payment methods. By selecting the desired method, the customer will be redirected to the checkout page of the chosen payment service. Below is a list of supported payment methods:
- Google Pay
- Apple Pay
- PayPal
- PayPal - Paga in 3 rate
- Bancomat Pay
- MyBank
- Giropay
- iDEAL
- Bancontact
- Multibanco
Once a new payment method has been enabled from the XPay back office, it will be necessary to save the plugin configuration to update the APM list and show the new payment method in the ecommerce site checkout.
Back office functionality
In the details of each order, the plugin provides information relating to transactions such as the details of the card used and the status of payments on the XPay gateway.
Refund
You can perform full or partial refund operations. This operation will reverse the desired amount by refunding the customer and changing the Magento order status. Here are the operations to perform:
- Log into the Magento administrative panel.
- In the left navigation bar, select Sales > Orders .
- Select the order to refund.
- In the menu on the left select Invoices and click on the corresponding invoice.
- Select Credit Note at the top right.
- At the bottom of the page it is now possible to make a refund by clicking on the Refund button. There is the Adjustment fee field where you can change the amount in order to proceed with a partial refund.
Capture
You can perform full or partial capture operations. This operation will capture the desired amount on the XPay gateway.
By default, total capture of the amount occurs automatically at midnight, use this option only in case of non-standard terminal configurations.
- Log into the Magento administrative panel.
- In the left navigation bar, select Sales > Orders .
- Select the order to be captured.
- Click on the Invoice button at the top right.
- Click on the Submit Invoice button at the bottom of the page.