🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 22, 2026

How to Accept Nexi XPay Payments in a Gravity Forms Form

GravityExtra
How to Accept Nexi XPay Payments in a Gravity Forms Form

If you run a cooking school in Bologna, a ceramics studio in Turin or a small association in Naples, there is a good chance your bank or your payment provider offers you Nexi XPay. It is one of the most common ways to accept cards in Italy, it is trusted by customers, and it comes with a test area and a clear technical specification. What is often missing is a clean way to connect it to the forms you already use. This guide shows how to take payments from a Gravity Forms form with Nexi XPay, what happens behind the scenes, and what to check before the first real payment.

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.

Why a Hosted Payment Page

There are two ways to take a card on a website. You can collect the card number on your own page and send it to the gateway, or you can send the customer to a page of the gateway and let them type the number there. The first way puts your server in the scope of strict card security rules. The second keeps card numbers away from your site completely, and it is the way Nexi describes as the simplest for a merchant. It is called Easy Payment, or Pagamento semplice in Italian.

The Gravity Forms Nexi XPay Payment Gateway Premium Add-on uses that page. Your form stays your form, with its fields, steps and design. The only moment the customer leaves your site is the moment they pay.

What You Need Before You Start

  • A Nexi XPay account with an alias and a MAC calculation key. Both come with the account. The test area gives you a pair for testing and test cards.
  • Gravity Forms 2.9 or newer, WordPress 6.5 or newer and PHP 7.4 or newer.
  • A site on HTTPS. Nexi posts the result of each payment to your site, and it only talks to public addresses with a valid certificate.
  • Euro as the form currency. The Easy Payment page takes euro only.

Step 1: Connect Your Nexi Account

Install the add-on, activate your license key and open Forms, Settings, Nexi XPay. Choose the Test environment, type the test alias and paste the test MAC key. Save, then press Test connection.

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.

The button sends a signed question about an order that does not exist. If Nexi answers that it has no such transaction, then it has read your alias, checked your signature and found them both good. If something is wrong, the message says what: an unknown alias, a wrong key, or a server clock that is more than five minutes away from the real time. The key is stored encrypted and is never shown again, so nobody who opens the settings page later can read it.

Step 2: Add a Nexi XPay Feed to Your Form

Open the settings of the form you want to be paid, choose Nexi XPay and add a feed. Choose Products and Services, and map the payment amount to the form total. If the form has product fields, the total is the sum of them, and the add-on reads it on the server when the form is sent. Nothing the browser says about the price is trusted.

Then choose how money is collected. Immediately asks Nexi to collect as soon as the card is authorised, so the entry becomes Paid. As set on the Nexi terminal follows your contract. That is useful when you want to hold the money first, for example for a class that has not happened yet, and collect it later or cancel it.

Write a payment description with merge tags, such as the form title and the entry number. It appears on the Nexi page and in your Nexi back office, which makes reconciliation easier. Pick a language for the page or let the add-on use the language of your site, and map the email and name fields so that Nexi can send the buyer a receipt.

Step 3: Pay With a Test Card

Open the form, fill it in and send it. The customer lands on a small page of your site that signs the payment request and passes it on to Nexi, then on the Nexi page. Use a test card from the Nexi test area to pay. When Nexi sends the customer back, the add-on has already received the result, checked it and updated the entry.

Open the entry. The side box shows the transaction code, the authorisation code and the amounts, and the notes list each step: the customer was sent to Nexi, the payment was completed, the notification emails were sent.

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.

How the Add-on Keeps the Result Honest

A payment form is only as good as its answer. Money is involved, so the add-on never believes a result just because it arrives. Two things come back from Nexi after a payment: a notification posted from the Nexi server to your site, and the customer’s own browser coming back to the confirmation page. Both carry a MAC, a signature computed from the transaction code, the result, the amount, the currency, the date, the time and the authorisation code together with your secret key. Only Nexi and your site know that key.

  • If the signature does not match, nothing changes. A made-up address typed into a browser cannot mark an entry as paid.
  • If the signature matches but the amount, the currency or the alias differs from the entry, the entry is not marked as paid and a note says what Nexi reported.
  • If the same result arrives twice, nothing happens twice. There is one payment record, one set of notes and one set of emails.
  • If the customer closes the browser after paying, the notification still completes the entry. If the notification never arrives, a check every fifteen minutes asks Nexi about the payment.

A declined card gives a failed entry with the reason in a note and a message to the customer with a button to try again on the same transaction code. A customer who cancels on the Nexi page gets a message that nothing was charged, and the entry says Cancelled.

Collect, Cancel and Refund From the Entry

When collection follows the terminal, an authorised entry shows buttons to collect the payment or cancel the authorisation. Nexi collects by itself too, at midnight or at the end of the guarantee period, and the add-on notices it when it checks the order. A payment that is Paid can be refunded in full or in part from the same box.

Every action asks for a confirmation and uses a one-time request id, so a double click or a refreshed page cannot send the same refund twice. If Nexi refuses, for example because the contract does not allow reversals, the entry stays as it was and the reason is written in a note.

Going Live

  1. Complete the Configuration section of the production back office at Nexi. The test and production back offices are separate, and what you set up in the test area does not carry over.
  2. Enter the production alias and the production MAC key in the settings, press Test connection for the production line and switch the environment to Production.
  3. Make a real payment of a small amount with your own card, check the entry and refund it from the entry screen.
  4. Make sure that your site address uses HTTPS and that nothing, such as a password or a firewall rule, stops Nexi from reaching the result address shown in the settings.

Questions People Ask

Does my site see the card number?

No. The number is typed on the Nexi page. The masked number that Nexi sends back after the payment is ignored by the add-on and is not stored or logged.

Can I take payments in other currencies?

Not with the Easy Payment page. It documents euro as the only currency of the request, so the add-on stops a form in another currency with a clear message.

Can the form offer a choice between paying online and paying later?

Yes. Add conditional logic to the feed and only the customers who choose to pay online are sent to Nexi.

What about recurring payments?

This version takes one-time payments. Recurring payments with Nexi need a contract number and a group code from a separate activation and are not part of the Easy Payment page.

Do other add-ons wait for the payment?

Yes. Feeds that other Gravity Forms add-ons delayed until payment run once the payment is authorised or collected, and form notifications can be held until then as well.

Take Payments With Nexi XPay in Gravity Forms

A booking, an order or a donation is only finished when the money is in. With a hosted page, signed requests, checked results and refunds from the entry screen, the Gravity Forms Nexi XPay Payment Gateway Premium Add-on gives your form the same trust your customers already have in the Nexi page.

Get the Nexi XPay Add-on

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