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

Gravity Forms WorldPay Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Integrations A–Z
On this page
  1. What you need
  2. Install and activate
  3. Connect Try and Live
  4. Add a WorldPay feed
  5. What the visitor sees
  6. Payment events
  7. The entry screen and refunds
  8. For developers
  9. Frequently asked questions
  10. Does this add-on take subscriptions?
  11. Where do I get the API credentials?
  12. Is the card entered on my site?
  13. Why does the confirmation sometimes take a few seconds?
  14. What happens when the amount at Worldpay is different?
  15. Which currencies work?
  16. Get the add-on

The Gravity Forms WorldPay Premium Add-on takes one-off card payments with your forms through Access Worldpay Hosted Payment Pages. When a visitor submits the form, the add-on creates a Worldpay payment page for the exact total Gravity Forms worked out on the server and sends the visitor there. The card is entered on the Worldpay page, never on your website. When the visitor comes back, the add-on reads the payment from Worldpay and marks the entry paid, failed or cancelled. This guide covers what you need, connecting the Try and Live environments, the feed, payment events, refunds and the questions merchants ask most.

What you need

  • WordPress 6.5 or newer, PHP 7.4 or newer and Gravity Forms 2.9 or newer.
  • A Worldpay merchant account with access to Access Worldpay and Hosted Payment Pages. Worldpay issues the API username and password (Basic authentication) and your merchant entity reference for each environment. Ask your Worldpay contact for the Try (test) credentials first, and for the Live credentials when you are ready to take real payments.
  • Your site on HTTPS with a valid certificate. Worldpay only sends payment events to HTTPS addresses.
  • A form with at least one product field (or a total). Donations work the same way.

The add-on talks only to the Access Worldpay API hosts: try.access.worldpay.com in the Try environment and access.worldpay.com in Live. Your visitor’s browser goes to the Worldpay payment page and back. Apart from that, the add-on checks gravityextra.com for your licence and plugin updates.

Install and activate

  • Upload the zip in Plugins → Add New → Upload Plugin and activate it.
  • Open Forms → Settings → WorldPay, enter your GravityExtra licence key and press Activate License.
  • The Worldpay account and Payment events sections appear once the licence is active.

Connect Try and Live

The add-on starts in the Try environment, Worldpay’s test environment, where you pay with Worldpay test cards and no money moves. Entries paid in Try carry a “Try — test payment” badge on the entry screen. Each environment has its own three settings:

  • API username and API password: the Basic authentication credentials Worldpay issued for that environment.
  • Merchant entity: the entity reference shown in your Worldpay dashboard under Developer Tools, for example PO1234567890. Worldpay refuses payments for an entity that is not yours.

When you save, the add-on checks the credentials with a harmless payment query that changes nothing. Credentials Worldpay refuses are not saved, and the previous ones stay in place. Accepted credentials are stored encrypted with a key derived from your site’s security salts, are never shown again and never written to a log. The settings page only shows the first and last four characters of the username.

WorldPay settings: Try or Live environment, the API username, password and merchant entity for each, statement text, page expiry, currency line and the connected status with the masked username
Settings: choose Try or Live and enter the credentials Worldpay issued. They are checked and stored encrypted.

Two more settings apply to both environments:

  • Statement text: up to 24 letters, digits and simple punctuation shown on the customer’s card statement. It defaults to your site name.
  • Payment page valid for: how long the visitor has to pay, from 5 minutes to 30 days (60 minutes by default). Entries still waiting after that are marked as cancelled by the status check.

The Currency line shows the Gravity Forms currency and how many decimal places Worldpay expects for it. Most currencies use two, the Japanese yen and the Korean won use none and a few dinars use three. A total that has more decimal places than the currency allows is refused on the form, so the visitor is never charged a rounded amount.

Test before you go live

Keep the Try environment selected, make a few test payments with Worldpay’s test cards (an approved card, a refused card and a cancelled page), check the entries and the notifications, and only then switch the Environment to Live and save the Live credentials.

Add a WorldPay feed

Open the form, go to Settings → WorldPay and add a feed.

The WorldPay feed: one-off products and services, the form total as the payment amount, billing name and address mapping, payment description with merge tags and the notification delay option
The feed: one-off payment for the form total, billing details and the payment description.
  • Transaction type: Products and Services or Donations. Both are one-off payments.
  • Payment amount: the form total or a single product field. The amount sent to Worldpay is always the amount Gravity Forms calculates on the server from your product prices and the quantities, never a number from the visitor’s browser.
  • Billing information: map the first name, last name and the parts of an Address field. The name and the full address are sent to the payment page so the visitor does not type them twice. The address is only sent when street, city, postcode and country are all filled in.
  • Payment description: shown to the visitor on the Worldpay page, up to 128 characters. Merge tags work, for example {form_title} #{entry_id}.
  • Notifications: tick Send form notifications only after the customer has paid to hold the form’s normal notifications until the payment is approved. They are then sent once.
  • Conditional logic: as with any Gravity Forms feed, the payment only runs when its conditions match.

What the visitor sees

A retreat booking form with name, email, billing address, two products and the total, and a Continue to payment button
The form your customer fills in. Card details are entered on the Worldpay page, not here.

The visitor fills in the form and presses the submit button. The entry is saved with the status Processing, the add-on creates the payment page with a unique transaction reference for the entry, and the visitor is sent to Worldpay. There they enter the card and complete any card checks their bank asks for. Then Worldpay sends them back to your site:

  • Paid: your normal Gravity Forms confirmation is shown, or your confirmation redirect runs.
  • Waiting: Worldpay can take up to a minute to make a new payment available to look up. Until then a short “Confirming your payment” message checks again by itself every few seconds.
  • Refused or failed: a message says the payment was not completed and nothing was charged, with a link back to the form.
  • Cancelled or expired page: a message says the payment was cancelled and nothing was charged.

Whatever page the visitor lands on, the add-on never trusts it on its own. It reads the payment from the Worldpay Payment Queries API and checks that the amount and currency match the entry before anything changes.

Payment events

Payment events (webhooks) tell your site straight away when a payment is authorised, sent for settlement, refused, cancelled, sent for refund or when a refund fails. Copy the Event address from the settings page and ask Worldpay to send the events of your Hosted Payment Pages there (merchants with a Worldpay dashboard may be able to switch them on themselves). Every event is checked before it is used:

  • With a signature secret: if Worldpay has enabled the Event-Signature header for your account, paste the shared secret (and the key id, usually 1) for the environment. Each event must then carry a matching HMAC-SHA256 signature of its body, or it is refused.
  • Without a secret: events are accepted only from the event addresses Worldpay publishes. Leave the Sender check on unless your site sits behind a proxy that hides the sender address; in that case add a signature secret instead.
  • An event is only a signal. The add-on reads the payment again from Worldpay before an entry changes, so a repeated or replayed event never completes a payment twice.

A status check runs every five minutes and reads payments that are still waiting, so a missed event never leaves an entry behind. It also marks entries as cancelled when their payment page has expired and Worldpay has no payment for them.

The entry screen and refunds

An entry paid through Worldpay: the WorldPay box with the status, last Worldpay event, transaction reference, payment ID, card, amounts, the refund form and Refresh status
The entry after payment: status, Worldpay references, refund and Refresh status.

Each entry paid through Worldpay has a WorldPay box with the payment status, the last Worldpay event, the transaction reference, the Worldpay payment ID, the card brand and last four digits, the amount and the amount refunded.

  • Refund: enter an amount (the rest of the payment is filled in) and press Refund. Full and partial refunds are supported once Worldpay has sent the payment for settlement. Until then the add-on tells you that Worldpay does not offer a refund yet.
  • Each refund form can only be sent once, and the add-on reads the payment again first, so the limit is what Worldpay still holds, not only what the entry says.
  • A refund that Worldpay later reports as failed is taken back off the entry with a note. A refund you make in the Worldpay dashboard is added to the entry from its event.
  • Refresh status reads the payment from Worldpay at once.

Gravity Forms notification events are available for Payment Completed, Payment Refunded, Payment Failed or Cancelled and Payment Cancelled at Worldpay, so you can e-mail the customer or your team at each step.

For developers

The request for the payment page can be extended with the gravityextra_worldpay_page_payload filter, for example to add risk data. The amount, currency, transaction reference and merchant entity are always set by the add-on after the filter runs.

// Add a custom field to the Worldpay payment page request (amount, currency,
// reference and entity are always set by the add-on and cannot be changed here).
add_filter( 'gravityextra_worldpay_page_payload', function ( $payload, $feed, $entry, $form ) {
    $payload['riskData']['custom']['string1'] = 'booking-' . $entry['id'];
    return $payload;
}, 10, 4 );

Two more filters exist: gravityextra_worldpay_event_remote_ip tells the add-on the real sender address when your site is behind a trusted proxy, and gravityextra_worldpay_event_ips adds addresses to the accepted list.

Frequently asked questions

Does this add-on take subscriptions?

No. It takes one-off payments for products, services and donations. Recurring payments are not part of this add-on.

Where do I get the API credentials?

From Worldpay. Access Worldpay credentials and the event set-up are issued for your merchant account, usually through your Worldpay contact. Ask for the Try credentials first.

Is the card entered on my site?

No. The visitor types the card on the Worldpay payment page. Your site only receives the result and the payment references, never the card number or security code.

Why does the confirmation sometimes take a few seconds?

Worldpay can take up to a minute to make a new payment available to look up. The waiting message checks again by itself, and the status check and payment events update the entry afterwards if the visitor closes the page.

What happens when the amount at Worldpay is different?

The entry is never marked as paid. It gets one error note with the expected and the reported amount, so you can look at the payment in your Worldpay dashboard.

Which currencies work?

The add-on uses your Gravity Forms currency. It must be a currency your Worldpay account accepts. Amounts are sent in minor units with the number of decimal places Worldpay uses for that currency.

Get the add-on

The add-on is available with a 1-site, 5-site or Unlimited licence on the Gravity Forms WorldPay Premium Add-on page. Updates and support are included while your licence is active.

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