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

Gravity Forms Yoco Premium Add-on Setup Guide

Updated 7 min read Gravity Forms Integrations A–Z
On this page
  1. What you need
  2. Install and activate
  3. Connect your Yoco account
  4. Add a feed to your form
  5. How a payment works
  6. Webhooks and their checks
  7. Refunds
  8. Subscriptions are not included
  9. Test and Live
  10. For developers
  11. Troubleshooting
  12. Privacy

The Gravity Forms Yoco Premium Add-on takes payments in South African rand with your forms through Yoco Checkout. When a visitor submits the form, the add-on creates a Yoco checkout for the exact total Gravity Forms worked out on the server and sends the visitor to the secure Yoco payment page. Card details and 3-D Secure happen there, never on your website. Yoco then sends a signed webhook to your site, and the entry is marked paid only when the signature, the checkout, the amount, the currency and the test or live mode all match.

This guide covers the setup, the webhook, the feed, payments, 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 Yoco account with the Checkout API integration. In the Yoco app, open the Checkout API integration and tap How to connect to copy your test secret key (sk_test_...) and, after domain verification, your live secret key (sk_live_...).
  • The Gravity Forms currency set to South African rand (ZAR). Yoco Checkout takes rand only, and payments of at least R2.00.
  • Your site public and on HTTPS, so Yoco can deliver its webhooks.
  • A form with at least one product field (or a total).

The add-on talks to payments.yoco.com (create checkout, refund, register webhook) and sends customers to the Yoco 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 → Yoco, enter your GravityExtra licence key and press Activate License.
  3. The Yoco account and Payment confirmations sections appear once the licence is active. Payments, webhooks and refunds work only with an active licence.

Connect your Yoco account

Yoco settings: Test or Live, the test and live secret keys, the ZAR currency line, the account-ready line with the masked key, the webhook address with the register button and the test and live webhook secrets
Settings: choose Test or Live, save your secret keys and register the webhook with one click. Keys and webhook secrets are stored encrypted.
  1. Leave Environment on Test for now.
  2. Paste the Test secret key and save. It must start with sk_test_; the Live field takes a key that starts with sk_live_.
  3. Press Register the Test webhook with Yoco. The add-on registers your webhook address with Yoco for the payment and refund events and saves the webhook secret Yoco returns. You do not need to copy anything.
  4. The Account line turns green and shows the masked key. Keys and webhook secrets are stored encrypted and are never shown again.

One webhook per environment

Yoco allows five webhooks per account and recommends one. Register once for Test and once for Live. If you registered this address yourself before, paste its whsec_ secret in the webhook secret field instead.

Add a feed to your form

The Yoco feed: products and services with the form total, first name, last name and e-mail mapped, the payment description, the order summary option and the notification option
The feed: map the billing fields, set the payment description and show each product on the Yoco page.
  1. Open the form, then Settings → Yoco → Add New.
  2. Choose Products and Services and the payment amount, usually the Form Total.
  3. Map the first name, last name and e-mail. They are kept with the payment in Yoco, which helps you match payments later.
  4. Set the payment description. Merge tags work, for example Booking #{entry_id}.
  5. Keep Order summary ticked to show each product and quantity on the Yoco page. When the lines do not add up to the total (for example with a coupon), one line with the description is shown instead.
  6. Keep Send form notifications only after the customer has paid ticked, so your booking e-mails go out for paid entries only.
A surf lesson booking form with name, e-mail, lesson date, group lessons and wetsuit hire with quantities, the total in rand and the Continue to payment button
The form your customer fills in. Card details are entered on the Yoco 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 Yoco checkout for that amount in cents, in rand, with a one-time idempotency key, so a retried request never creates a second checkout.
  2. The visitor goes straight to the Yoco payment page and pays there.
  3. Yoco sends a signed payment.succeeded webhook to your site. The add-on checks the signature and its time stamp, then the checkout id, the amount, the currency and the test or live mode. Only then is the entry marked Paid, with the payment id and the card in the notes.
  4. The visitor comes back to your form page and sees your confirmation. If the webhook is a few seconds late, the page waits and checks again by itself.

The success page never marks an entry paid

Yoco asks merchants not to trust the success redirect, and the add-on does not: the return page only shows the state of the entry. Payments are confirmed by the signed webhook alone, and a repeated webhook never completes a payment twice.

When the visitor cancels on the Yoco page, or the payment does not go through, your form page says that nothing was charged and offers a link back to the same Yoco payment page.

Webhooks and their checks

  • The signature is an HMAC-SHA256 of the webhook id, the time stamp and the exact body, made with the webhook secret. A wrong or missing signature is refused with HTTP 403.
  • Events older or newer than three minutes are refused, so a recorded webhook cannot be replayed later.
  • Events for checkouts of other websites on the same Yoco account are ignored.
  • An event that does not match the entry (another amount, currency or mode) is noted on the entry and never marks it paid.
  • The last accepted webhook is shown in the settings, so you can see at a glance that Yoco reaches your site.

Refunds

An entry paid through Yoco and partly refunded: the Yoco box with the status, checkout, payment, card, amount, refunded amount and the refund form
The entry after payment: status, checkout and payment ids, the card used, and refunds from the entry screen.

Open a paid entry. The Yoco box shows the status, the checkout and payment ids, 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 Yoco with a one-time idempotency key. Yoco usually answers that the refund is being processed: the box then shows the amount as waiting, and the entry becomes Partially Refunded or Refunded when the signed refund.succeeded webhook arrives. If Yoco reports refund.failed, the reason is noted on the entry and the amount can be refunded again.

Refunds you make in the Yoco app are recorded on the entry too, when their webhook arrives. Yoco does not refund test payments, so the refund form is shown for live payments only.

Subscriptions are not included

Yoco Checkout takes one-off payments. It has no self-serve recurring billing, so the add-on does not offer the Subscription transaction type in the feed. For monthly classes or memberships, take one payment per period, for example with one form submission per month.

Test and Live

  • In Test, entries are marked as test payments and no money moves. Pay with the test card details shown in the Yoco app under the Checkout API integration.
  • Yoco unlocks the live keys once your website domain is verified in the Yoco app. Then paste the live secret key, choose Live, save and press Register the Live webhook with Yoco.
  • Make one small real payment and refund it from the entry.
  • Entries remember the environment they were paid in, and webhooks are checked with the secret of that environment.

For developers

The webhook address can be changed with the gravityextra_yoco_webhook_url filter. Register the webhook again after changing it. Amounts, the currency and the checkout are always set by the add-on.

// Receive Yoco webhooks on another public address of the same site
// (for example when the home page is behind a login).
add_filter( 'gravityextra_yoco_webhook_url', function ( $url ) {
    return add_query_arg( 'callback', 'gfyoco', home_url( '/pay/' ) );
} );

Troubleshooting

What you see What to do
The account line asks you to register the webhook Press Register the Test webhook with Yoco (or Live). Without the webhook secret the form does not take payments, because the add-on could not confirm them.
“This is not a Yoco secret key for this environment” The Test field takes a key that starts with sk_test_, the Live field one that starts with sk_live_. Public keys (pk_) are not used.
Entries stay Processing after payment Yoco could not reach the webhook address, or the webhook secret is from another registration. Check that the site is public and on HTTPS, that no firewall or maintenance mode blocks POST requests, and register the webhook again.
“Online payments must be at least R2.00” Yoco does not take payments under R2.00. Check your prices or coupons.
“Online payment is not available in USD” Yoco Checkout takes South African rand only. Set the Gravity Forms currency to ZAR.
A refund fails Refunds work for live payments only (Yoco does not refund test payments). The entry note shows Yoco’s answer; you can also refund in the Yoco app, and the add-on records that refund on the entry.

Privacy

The add-on sends Yoco the amount, the currency, the payment description, the product lines, the entry and form numbers, the customer name and e-mail (when you map them) and the return addresses. Card numbers are entered on the Yoco page and never reach your site. Secret keys and webhook secrets 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