🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Nexi XPay Payment Gateway Premium Add-on Setup Guide

Updated 9 min read Gravity Forms Payments & Pricing
On this page
  1. Video walkthrough
  2. What You Get
  3. Requirements
  4. How a Payment Works
  5. Quick Start
  6. Account Settings
  7. Feed Settings
  8. Collect, Cancel and Refund
  9. Entry Statuses
  10. Result Notifications and the Nexi Back Office
  11. Security
  12. For Developers
  13. Frequently Asked Questions
  14. Do I need a PCI certificate?
  15. Which currencies can I use?
  16. Are subscriptions supported?
  17. The entry stays on Processing. What now?
  18. Why does the Test connection button say the credentials were not accepted?
  19. Can the customer try again after a decline?
  20. What happens when the customer closes the browser after paying?
  21. Can I refund a payment that was collected today?
  22. Does it work with the delayed feeds of other add-ons?

Video walkthrough

Gravity Forms Nexi XPay Payment Gateway Setup Guide: Alias & MAC Key (WordPress Side)
Video setup guide: Gravity Forms Nexi XPay Payment Gateway Watch on YouTube

The Gravity Forms Nexi XPay Payment Gateway Premium Add-on lets a Gravity Forms form take card payments through Nexi XPay, the payment gateway used by thousands of shops, studios and associations in Italy and across Europe. The customer fills in your form, is sent to the secure Nexi payment page, pays there and comes back to a confirmation. Card numbers are typed on the Nexi page only, so they never reach your server, your database or your logs.

A Gravity Forms booking form for a pasta-making class with name, email, quantities, shipping, a total in euro and a button that says Pay securely with Nexi
An ordinary Gravity Forms form. The total is worked out on the server and sent to Nexi in euro cents.

What You Get

  • A payment feed for Products and Services and for Donations. The amount is always worked out on the server from the entry, never taken from the browser.
  • The hosted Easy Payment page of Nexi XPay (called Pagamento semplice in Italian). The request is signed on your server with your MAC calculation key, and the key never leaves the server.
  • The result of the payment is checked twice with the documented MAC: the notification Nexi posts to your site, and the customer’s return. A result with a wrong signature, amount, currency or alias never marks an entry as paid.
  • Updates that are safe to repeat: a notification sent twice or a confirmation page that is reloaded changes nothing twice.
  • A status check every fifteen minutes that asks Nexi about payments still waiting, so a notification that never arrived does not leave an entry behind.
  • Collection right away, or as set on your Nexi terminal. In the second case an authorised entry can be collected or cancelled from its own screen.
  • Full and partial refunds from the entry screen, with a confirmation, a one-time request id and a capability check.
  • Test and production environments, each with an alias and a key, a Test connection button and a clear test label on every entry.
  • Gravity Forms payment statuses, entry notes, payment notification events, held form notifications and delayed feeds of other add-ons.

Requirements

  • Gravity Forms 2.9 or newer, WordPress 6.5 or newer and PHP 7.4 or newer.
  • A Nexi XPay account. The alias and the MAC calculation key come with the account, and Nexi gives you a test area with test cards before you go live. No partner approval is needed.
  • Forms that use the euro. The Easy Payment page of Nexi accepts euro only, and the add-on tells you if the form currency is different.
  • A site on HTTPS with a public address. Nexi posts the result of each payment to your site, and the address must not sit behind a password.

How a Payment Works

  1. The customer sends the form. The add-on checks the licence, the keys, the currency and the amount, saves the entry with the status Processing and sends the customer to a small page of your own site.
  2. That page signs the request with your MAC key and posts it to Nexi. It holds the alias, the amount in euro cents, the currency, a transaction code, the return addresses, your description and the buyer email and name.
  3. The customer pays on the Nexi page. Cards, 3-D Secure and the other methods of your contract are handled by Nexi.
  4. Nexi posts the result to your site and sends the customer back. The add-on checks the MAC, the amount, the currency and the alias, and then marks the entry Paid, or Authorized when collection follows the terminal.
  5. The confirmation of the form is shown, held notifications are sent once and other add-ons that waited for the payment run their feeds.

Quick Start

  1. Install and activate the add-on, then activate your license key under Forms, Settings, Nexi XPay.
  2. Enter the alias and the MAC calculation key of your Nexi test area, save, and press Test connection.
  3. Set the Gravity Forms currency to euro under Forms, Settings, Currency.
  4. Open the settings of your form, choose Nexi XPay and add a feed. Choose Products and Services, map the payment amount to the form total and map the email and the name.
  5. Send the form and pay with a Nexi test card. The entry becomes Paid and its notes tell you what happened.
  6. Complete the Configuration of the production back office at Nexi, switch the environment to Production and enter the production alias and key.

Account Settings

The Nexi XPay settings in Gravity Forms: environment, test and production alias, MAC calculation key fields, a Test connection button and the requirements list with the result address
The account settings: an alias and a MAC key per environment, a Test connection button and the requirements checklist.

Open Forms, Settings, Nexi XPay. The Environment choice decides which alias and key are used. Test is the default, and every entry paid in the test environment carries a test label.

  • Alias: the merchant profile code Nexi gave you. It is sent with every payment, so it is not a secret.
  • MAC calculation key: the secret key that signs requests and checks results. It is stored encrypted, the field is never filled in again, and leaving it empty keeps the saved key.
  • Test connection: asks Nexi for the details of an order that does not exist. A signed request that Nexi answers with transaction not found proves that the alias and the key are accepted. A wrong alias, a wrong key or a clock that is more than five minutes off is reported in plain words.
  • Requirements: shows whether the site uses HTTPS and the forms use euro, and the result address that is sent with each payment.

Feed Settings

  • Transaction type: Products and Services, or Donations. Recurring payments need a Nexi contract and are not part of the Easy Payment page, so they are not offered.
  • Collection: Immediately sends the collection flag with the request, so a successful payment is Paid at once. As set on the Nexi terminal follows your contract: Nexi collects at midnight, or later within the guarantee period, and the entry is Authorized until then.
  • Payment description: shown on the Nexi page and in the Nexi back office. Merge tags work. The characters hash, apostrophe and quote are removed because the Nexi page does not accept them, and the text is cut to 140 characters.
  • Payment page language: Italian, English, Spanish, French, German or Portuguese, or the language of the site.
  • Notifications: hold the form notifications until the payment is authorised.
  • Billing fields: the email goes to Nexi, which sends the buyer a receipt, and the name is shown on the payment record.

Conditional logic works on the feed, so a form can offer Pay online now and Pay at the studio and send only the first to Nexi.

Collect, Cancel and Refund

Open an entry and look at the Nexi XPay box on the right. It shows the status, the transaction code, the authorisation code, the card brand and the amounts.

  • Collect the payment is shown for an Authorized entry. It asks Nexi to collect the amount, and the entry becomes Paid.
  • Cancel the authorisation releases an amount that was not collected. Nexi accepts the total amount only, and the entry becomes Voided.
  • Refund is shown for a Paid entry. Type an amount up to what is left, confirm, and Nexi reverses or refunds it. The entry becomes Partially Refunded or Refunded.
  • Refresh status reads the order from Nexi, which picks up a collection, a cancellation or a refund that was made in the Nexi back office.
A Gravity Forms entry paid through Nexi XPay with a side box showing the transaction code, authorisation code, amounts and a partial refund, and notes that describe each step
The entry shows what happened: the payment, the notes and a refund that was made from the entry screen.

Each action uses a nonce, a capability check and a one-time request id, so a double click or a reloaded page cannot send the same refund twice. If Nexi refuses, the entry is left alone and the reason is written in a note.

Entry Statuses

  • Processing: the customer was sent to Nexi and the result has not arrived.
  • Authorized: Nexi authorised the card and has not collected yet.
  • Paid: the money was collected.
  • Partially Refunded and Refunded: money went back to the customer.
  • Voided: an authorisation was cancelled.
  • Cancelled: the customer left the Nexi page without paying.
  • Failed: the card was declined, the amount did not match or the customer never finished.

Result Notifications and the Nexi Back Office

You do not enter a notification address at Nexi. The add-on sends it with every payment, and the Settings page shows it for reference. Nexi expects the answer HTTP 200 for a notification it was able to deliver, and the add-on gives that, even for a notification it has seen before. A notification with a wrong MAC gets HTTP 403 and changes nothing.

The test and the production back offices of Nexi are configured separately. After the test payments work, open the production back office and complete its Configuration section, for example the logo and the notification emails, so that production behaves like the test area.

Security

  • No card data is received, stored or logged. The masked card number that Nexi sends back is ignored.
  • The MAC key is stored encrypted with AES-256-GCM in its own option and is never printed back into a page.
  • The payment request, the return, the cancel link and the payment page link are signed per entry, and a link of a paid entry stops working.
  • Every call to Nexi uses HTTPS with certificate checks. The answers of the back office carry a MAC, and an answer that does not match is ignored.

For Developers

  • gravityextra_nexi_payment_fields filters the fields posted to Nexi, for documented optional fields such as the note fields.
  • gravityextra_nexi_notify_url filters the result address, for example behind a proxy.
  • gravityextra_nexi_api_base filters the back office address, for tests.

Frequently Asked Questions

Do I need a PCI certificate?

No. The customer types the card on the Nexi page and your site never sees it. That is why this add-on uses the hosted Easy Payment page and has no card fields.

Which currencies can I use?

Euro. The Easy Payment page documents euro as the only currency of the request. A form in another currency is stopped with a clear message and the settings page warns you.

Are subscriptions supported?

Not in this version. Recurring payments with Nexi need a contract number and a group code that come from a separate activation, and they are not part of the Easy Payment page.

The entry stays on Processing. What now?

Open the entry and press Refresh status. If Nexi has no payment for the transaction code, the customer did not finish. An entry that waits for more than three hours without a payment at Nexi is marked Failed by the status check.

Why does the Test connection button say the credentials were not accepted?

Check that the alias and the key belong to the same environment. The test area and production have different ones. Also check that the clock of your server is right, because Nexi refuses a request that is more than five minutes old.

Can the customer try again after a decline?

Yes. The message has a button that opens the payment page again with the same transaction code. Nexi allows a limited number of attempts per code and says so on its own page.

What happens when the customer closes the browser after paying?

Nexi still posts the result to your site, so the entry is completed without the customer coming back. The status check is the second line of defence.

Can I refund a payment that was collected today?

Yes. Nexi decides whether the amount is reversed or refunded from the state of the order. A payment that is only authorised can be cancelled for the total amount only.

Does it work with the delayed feeds of other add-ons?

Yes. Feeds that other add-ons delayed until payment run once the payment is authorised or collected.

Ready to take payments in Gravity Forms with Nexi XPay?

Get the Nexi XPay Add-on

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr