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

Gravity Forms Viva.com Premium Add-on Setup Guide

Updated 9 min read Gravity Forms Integrations A–Z
On this page
  1. What you need
  2. Install and activate
  3. Connect your Viva.com account
  4. Create the payment source
  5. Add the webhook
  6. Add a feed to your form
  7. How a payment works
  8. Refunds
  9. Subscriptions
  10. Demo and Live
  11. For developers
  12. Troubleshooting
  13. Privacy

The Gravity Forms Viva.com Premium Add-on takes payments with your forms through Viva.com Smart Checkout. When a visitor submits the form, the add-on creates a Viva.com payment order for the exact total Gravity Forms worked out on the server and sends the visitor to the secure Smart Checkout page. The visitor pays there by card, digital wallet or a local payment method your Viva.com account offers, so card details never reach your website. Before an entry changes, the add-on retrieves the transaction from Viva.com and checks the order code, the amount, the currency and the status.

This guide covers the setup, the payment source, the webhook, the feed, payments, refunds, subscriptions 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 Viva.com business account. Start with a free demo account for testing; the live account is separate and has its own credentials.
  • From Settings → API Access in Viva.com: the Smart Checkout client ID and client secret, and the Merchant ID and API Key (needed for refunds, subscriptions and the webhook).
  • The Gravity Forms currency set to one of euro (EUR), pound sterling (GBP), złoty (PLN), leu (RON), koruna (CZK), forint (HUF), Swedish krona (SEK) and Danish krone (DKK). A currency other than the one of your Viva.com account needs Multicurrency on your account.
  • Your site public and on HTTPS, so Viva.com can reach the webhook address.
  • A form with at least one product field (or a total).

The add-on talks to accounts.vivapayments.com (access tokens), api.vivapayments.com (payment orders and transactions) and www.vivapayments.com (refunds, recurring charges and the webhook key), or their demo versions, and sends customers to the Smart Checkout 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 → Viva.com, enter your GravityExtra licence key and press Activate License.
  3. The Viva.com account and Payment source sections appear once the licence is active. Payments, webhooks, refunds and recurring charges work only with an active licence.

Connect your Viva.com account

Viva.com settings: Demo or Live, the Smart Checkout client ID and secret, the Merchant ID, API Key and payment source code for each environment, the EUR currency line, the account-ready line, the payment source URLs and the webhook address
Settings: choose Demo or Live, save your Viva.com credentials and copy the payment source URLs and the webhook address. Secrets are stored encrypted.
  1. Leave Environment on Demo for now.
  2. Paste the demo Smart Checkout client ID (it ends with .apps.vivapayments.com) and the client secret.
  3. Paste the demo Merchant ID and API Key.
  4. Enter the payment source code of this website (see the next step). Leave it empty to use your default source.
  5. Save. The Account line turns green and shows masked values. Secrets are stored encrypted and never shown again.

Create the payment source

Viva.com sends the customer back to the Success URL or the Failure URL of a payment source. In Viva.com, open Sales → Online payments → Websites/Apps and add a source:

  1. Protocol https and the domain name shown in the add-on settings.
  2. Integration method Redirection/Native Checkout v2.
  3. Copy the Success URL and the Failure URL from the add-on settings (for a site at the domain root they are ?gfviva=success and ?gfviva=fail).
  4. Upload your logo: it is shown on the payment page.
  5. Save and copy the four-digit source code into the add-on settings.

Keep the parameter names

Viva.com adds the transaction id as t and the order code as s to the return address. Keep these default names in the advanced settings of the source.

Add the webhook

  1. In the add-on settings, press Get the Demo webhook verification key. The add-on asks Viva.com for the key with your Merchant ID and API Key and saves it.
  2. In Viva.com, open Settings → API Access → Webhooks and press Create Webhook.
  3. Paste the webhook address from the add-on settings and press Verify. Viva.com calls the address, and the add-on answers with the key.
  4. Choose Transaction Payment Created, tick Active and save. Add the same address for Transaction Failed and Transaction Reversal Created.

Viva.com webhooks are not signed. The add-on therefore treats every webhook as a hint only: it retrieves the transaction from Viva.com with your own credentials and checks it against the entry before anything changes. The last accepted webhook is shown in the settings.

Add a feed to your form

The Viva.com feed: products and services with the form total, first name, last name and e-mail mapped, the payment description and the notification option
The feed: choose a one-off payment or a subscription, map the billing fields and set the payment description.
  1. Open the form, then Settings → Viva.com → Add New.
  2. Choose Products and Services for a one-off payment, usually with the Form Total, or Subscription (see below).
  3. Map the first name, last name and e-mail. They are filled in on the Viva.com page, so the customer does not type them again.
  4. Set the payment description, shown to the customer and on the receipt. 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 sea kayak tour booking form with name, e-mail, tour date, tours and dry bag sets with quantities, the total in euro and the Continue to payment button
The form your customer fills in. Card details are entered on the Viva.com 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 Viva.com payment order for that amount in the smallest currency unit (cents), with your source code and the entry number as the merchant reference.
  2. The visitor goes straight to Smart Checkout and pays there.
  3. Viva.com sends the visitor back to the Success URL with the transaction id. The add-on retrieves that transaction from Viva.com and checks the order code, the amount, the currency and the status. Only then is the entry marked Paid, with the transaction id and the card in the notes.
  4. The visitor sees your confirmation on the form page. If the payment is still pending, the page waits and checks Viva.com again by itself.
  5. The Transaction Payment Created webhook arrives as well and is checked the same way. A payment is never completed twice.

The return address never marks an entry paid on its own

Viva.com asks merchants to verify every payment and not to rely on the Success URL. The add-on does: anyone can open the address, but only a transaction retrieved from Viva.com that matches the entry marks it paid.

When the visitor cancels on the Viva.com page or the payment does not go through, your form page says that nothing was charged and offers a link back to the same payment page, which stays open for 30 minutes.

Refunds

An entry paid through Viva.com and partly refunded: the Viva.com box with the status, order code, transaction, card, amount, refunded amount and the refund form
The entry after payment: status, order code and transaction, the card used, and refunds from the entry screen.

Open a paid entry. The Viva.com box shows the status, the order code, the transaction, the card used and the amounts. Type an amount and press Refund to refund all or part of the payment. The add-on sends the refund to Viva.com with a one-time idempotency key, so a double click never refunds twice, and the entry becomes Partially Refunded or Refunded as soon as Viva.com answers. Refunds need Allow refunds in Viva.com Settings → API Access.

Refunds you make in your Viva.com account are recorded on the entry too, when the Transaction Reversal Created webhook arrives; the add-on retrieves the refund and checks that it belongs to this payment and fits in what is left.

Subscriptions

Choose Subscription in the feed, the recurring amount (usually the form total), the billing cycle (every so many days, weeks, months or years) and the number of payments, or no limit. Trial periods and setup fees are not offered.

  1. Tick Allow recurring payments and pre-auth captures via API in Viva.com Settings → API Access. The Merchant ID and API Key must be saved.
  2. The customer pays the first period on Smart Checkout. The payment order allows recurring payments, so Viva.com offers only payment methods that support them.
  3. After the first payment is checked, the entry becomes Active and the next charge date is set.
  4. A WordPress scheduled task checks every hour and charges the same payment method when a period is due. Each new transaction is retrieved and checked before it is recorded on the entry.
  5. A declined charge is tried again the next day; after three declines the subscription is cancelled. When the number of payments is reached, the subscription expires.

Never charged twice

If Viva.com gives no clear answer to a charge, the add-on puts the subscription on hold instead of trying again. Check the customer’s payments in Viva.com, then press Resume recurring charges on the entry. The Cancel Subscription button of Gravity Forms stops all further charges.

WordPress runs scheduled tasks when the site has visitors. For exact timing on a quiet site, let your host call wp-cron.php every few minutes. Refund subscription payments in your Viva.com account.

Demo and Live

  • In Demo, entries are marked as test payments and no money moves. Pay with the test cards listed in the Viva.com developer portal, for amounts of 0,30 € or more.
  • For Live, paste the live credentials, create the payment source and the webhook in your live account, choose Live and save.
  • Make one small real payment and refund it from the entry.
  • Entries remember the environment they were paid in; webhooks and refunds use the credentials of that environment.

For developers

The webhook address can be changed with the gravityextra_viva_webhook_url filter; update the address in Viva.com after changing it. Amounts, the currency and the order are always set by the add-on.

// Receive Viva.com webhooks on another public address of the same site
// (for example when the home page is behind a login).
add_filter( 'gravityextra_viva_webhook_url', function ( $url, $env ) {
    return add_query_arg( array( 'callback' => 'gfviva', 'viva_env' => $env ), home_url( '/pay/' ) );
}, 10, 2 );

Troubleshooting

What you see What to do
“A Smart Checkout client ID ends with .apps.vivapayments.com” Copy the client ID of the Smart Checkout Credentials in Settings → API Access, not the Merchant ID. Demo and Live accounts have different credentials.
The customer returns but the entry stays Processing The payment is not finished yet (some local payment methods confirm later) or the Success URL of the payment source is not the one shown in the settings. The entry updates when the Transaction Payment Created webhook arrives; check that the webhook is active in Viva.com.
Viva.com cannot verify the webhook address Save the Merchant ID and API Key first and press Get the webhook verification key. The site must be public and on HTTPS, and no maintenance mode or firewall may block requests from Viva.com.
“Online payment is not available in USD” Smart Checkout takes euro (EUR), pound sterling (GBP), złoty (PLN), leu (RON), koruna (CZK), forint (HUF), Swedish krona (SEK) and Danish krone (DKK). Set the Gravity Forms currency to one of them.
“Online payments must be at least 0,30 €” Viva.com takes payment orders from 30 in the smallest currency unit.
A refund fails Tick Allow refunds in Viva.com Settings → API Access. The entry note shows the answer from Viva.com.
Recurring charges are on hold Viva.com gave no clear answer to a charge. Check the customer’s payments in Sales → Sales Transactions, then press Resume recurring charges on the entry.

Privacy

The add-on sends Viva.com the amount, the currency, the payment description, the entry and form numbers, and the customer name and e-mail when you map them. Card numbers are entered on the Viva.com page and never reach your site. Client secrets, API keys and access tokens are stored encrypted with keys from your site’s WordPress salts. Uninstalling the add-on removes its settings, including the credentials, and stops the recurring task.

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