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

Gravity Forms PayU 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 your PayU POS
  4. Notifications: nothing to set up
  5. Add a feed to your form
  6. How a payment works
  7. Refunds
  8. Subscriptions
  9. Sandbox and Production
  10. For developers
  11. Troubleshooting
  12. Privacy

The Gravity Forms PayU Premium Add-on takes payments with your forms through PayU. When a visitor submits the form, the add-on creates a PayU order for the exact total Gravity Forms worked out on the server and sends the visitor to the secure PayU payment page. The visitor pays there with a card, BLIK, a pay-by-link bank transfer or another method your POS offers, so card and bank details never reach your website. Before an entry changes, the add-on retrieves the order from PayU and checks the order, the amount, the currency and the status.

Which PayU?

This add-on works with PayU accounts in Poland and Czechia (the PayU GPO Europe REST API, secure.payu.com). PayU in other regions, for example PayU India or PayU Latin America, uses different APIs and accounts and is not supported.

This guide covers the setup, the feed, payments, notifications, refunds and going live. The add-on costs one site $49 a year, five sites $69 a year, unlimited sites $199 a year.

What you need

  • WordPress 6.5 or newer, PHP 7.4 or newer (with the openssl extension) and Gravity Forms 2.9 or newer.
  • A PayU merchant account in Poland or Czechia with a shop and a point of sale (POS) of the REST API (Checkout) type. For testing, register a free PayU sandbox account; it is separate and has its own keys.
  • The four Configuration keys of the POS: POS ID (pos_id), Second key (MD5), OAuth protocol – client_id and OAuth protocol – client_secret.
  • The Gravity Forms currency set to the currency of the POS: złoty (PLN), Czech koruna (CZK), euro (EUR) and the other currencies PayU sets up for a POS (GBP, USD, HUF, RON, BGN, CHF, DKK, NOK, SEK). Each POS takes one currency.
  • Your site public and on HTTPS, so PayU can reach the notification address.
  • A form with at least one product field (or a total).

The add-on talks to secure.payu.com (or secure.snd.payu.com in the sandbox) for access tokens, orders and refunds, and sends customers to the PayU payment page. Apart from that, it checks gravityextra.com for your licence and plugin updates.

Install and activate

  1. Upload the zip in Plugins → Add New → Upload Plugin and activate it.
  2. Open Forms → Settings → PayU, enter your GravityExtra licence key and press Activate License.
  3. The PayU sections appear once the licence is active. Payments, notifications and refunds work only with an active licence.

Connect your PayU POS

PayU settings: Sandbox or Production, the POS ID, second key, OAuth client_id and client_secret for each environment, the PLN currency line, the POS-ready line and the notification address
Settings: choose Sandbox or Production and save the four configuration keys of your PayU POS. Keys are stored encrypted; the notification address is sent with every order.
  1. In the PayU panel, open Online payments → My shops, choose your shop, then Points of sale (POS) and your POS.
  2. In the add-on, leave Environment on Sandbox for now.
  3. Copy the four Configuration keys of your sandbox POS into the Sandbox fields: POS ID, Second key (MD5), OAuth client_id and OAuth client_secret.
  4. Save. The POS line turns green and shows the POS ID and a masked second key. The keys are stored encrypted and never shown again.
  5. The Currency line reminds you that the form currency must be the currency of the POS.

Notifications: nothing to set up

PayU tells your site about every status change of an order by sending a notification to the notifyUrl of the order. The add-on sends its notification address with every order, so you do not enter anything in the PayU panel. The address is shown in the settings, together with the last notification the add-on accepted.

Every notification is signed and checked

PayU signs each notification with your second key in the OpenPayu-Signature header. The add-on hashes the exact body with the second key and refuses any notification whose signature does not match. Even a valid notification is only a hint: the add-on then retrieves the order from PayU with your own access token and compares the order, the extOrderId, the amount, the currency and the status before the entry changes.

If your firewall or security plugin filters incoming requests, allow PayU’s notification addresses, which PayU lists in its documentation.

Add a feed to your form

The PayU feed: products and services with the form total, first name, last name, e-mail and phone mapped, the payment description and the notification option
The feed: map the billing fields and set the payment description PayU shows in your panel.
  1. Open the form, then Settings → PayU → Add New.
  2. Choose Products and Services and usually the Form Total.
  3. Map the first name, last name, e-mail and phone. They are sent to PayU as the buyer, so the customer does not type them again.
  4. Set the payment description, shown in your PayU panel. Merge tags work, for example Booking #{entry_id}.
  5. Keep Send form notifications only after the customer has paid ticked, so your booking e-mails go out for paid entries only.
A pottery workshop booking form with name, e-mail, phone, workshop date, workshop places and glazing with quantities, the total in złoty and the Continue to payment button
The form your customer fills in. Card, BLIK or bank details are entered on the PayU page, not here.

How a payment works

  1. The visitor submits the form. Gravity Forms works out the total on the server, and the add-on creates a PayU order for that amount in the lowest currency unit (grosze, haléře or cents), with your POS ID, a unique extOrderId for the entry, the products, the buyer, the notification address and a signed return address.
  2. PayU answers with the address of its payment page, and the visitor goes straight there to pay.
  3. PayU sends a signed notification when the status changes. The add-on checks the signature, retrieves the order and marks the entry Paid only when the status is COMPLETED and the order, the amount and the currency match.
  4. PayU sends the visitor back to your form page. The return page also asks PayU for the order; if the payment is not finished yet, it waits and checks again by itself, then shows your confirmation.
  5. A payment is never completed twice, however many notifications or returns arrive.
PayU status Entry
PENDING Processing: the payment is still running, nothing changes yet
WAITING_FOR_CONFIRMATION Pending, with a note: auto-receive is off for the POS; confirm or cancel the order in the PayU panel
COMPLETED Paid, with the PayU order and the payment method in the notes
CANCELED Failed: the customer has not been charged

When the visitor cancels on the PayU page, your form page says that nothing was charged. If the order is still open, it offers a link back to the same PayU page.

Refunds

An entry paid through PayU and partly refunded: the PayU box with the status, PayU order, extOrderId, PayU status, method, POS, amount, refunded amount and the refund form
The entry after payment: status, PayU order and method, and refunds from the entry screen.

Open a paid entry. The PayU box shows the status, the PayU order, your extOrderId, the payment method and the amounts. Type an amount and press Refund to refund all or part of the payment; you can refund in several steps up to the amount paid. Each refund carries a one-time extRefundId, so a double click never refunds twice.

PayU queues refunds and finishes them a little later. Until then the box shows the amount as Refund pending at PayU and keeps it aside. When PayU reports the refund finished, the add-on retrieves it and the entry becomes Partially Refunded or Refunded. If PayU cancels a refund, the amount becomes refundable again. Refunds you make in the PayU panel are recorded on the entry the same way.

Subscriptions

Subscriptions are not offered. Recurring card payments with PayU use card tokens that PayU has to configure on your POS first, so they are not something the add-on can switch on by itself. Each form submission is one payment.

Sandbox and Production

  • In the Sandbox, entries are marked as test payments and no money moves. Pay with the test cards or the test payment methods listed in the PayU sandbox documentation.
  • For Production, paste the four configuration keys of your production POS, choose Production and save.
  • Make one small real payment and refund it from the entry.
  • Entries remember the environment they were paid in; notifications and refunds use the keys of that environment.

For developers

The notification address can be changed with the gravityextra_payu_notify_url filter. The order body can be adjusted with gravityextra_payu_order_body; the amount, the currency and the extOrderId are always checked again when the order is retrieved.

// Receive PayU notifications on another public address of the same site
// (for example when the home page is behind a login).
add_filter( 'gravityextra_payu_notify_url', function ( $url, $env ) {
    return add_query_arg( array( 'callback' => 'gfpayu', 'payu_env' => $env ), home_url( '/pay/' ) );
}, 10, 2 );

Troubleshooting

What you see What to do
“The POS ID has digits only” Copy the POS ID (pos_id) from the Configuration keys of your POS, not the shop ID. Sandbox and production POS have different keys.
“PayU did not create the order (http_401 …)” in the entry notes The OAuth client_id or client_secret does not belong to the chosen environment. Paste them again from the same POS as the POS ID.
“PayU did not create the order (… ERROR_INCONSISTENT_CURRENCIES …)” The POS is set up for another currency. Set the Gravity Forms currency to the currency of the POS, or use a POS for this currency.
The customer returns but the entry stays Processing PayU has not finished the payment yet (a bank transfer can take a moment). The return page checks again by itself, and the entry updates when the notification arrives. Check that the site is public and that no firewall blocks PayU.
The entry is Pending with “waiting for your confirmation” Automatic collection (auto-receive) is off for your POS. Confirm or cancel the order in the PayU panel, or ask PayU to turn auto-receive on.
“Online payment is not available in USD” The form currency is not one PayU takes for this add-on. Choose the currency of your POS in Forms → Settings.
A refund stays “pending at PayU” PayU queues refunds and finishes them later. The entry books the refund when PayU reports it finished. If PayU cancels it, the amount can be refunded again.

If an entry stays Processing although the customer paid, open it and press Check the order with PayU in the PayU box: the add-on retrieves the order and updates the entry.

Privacy

The add-on sends PayU the amount, the currency, the payment description, the products, the entry number in the extOrderId, the customer IP address that PayU requires, and the customer name, e-mail and phone when you map them. Card and bank details are entered on the PayU page and never reach your site. The second key, the client secret and access tokens are stored encrypted with keys from your site’s WordPress salts. Uninstalling the add-on removes its settings, including the keys.

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