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

Gravity Forms Stax Payment Setup Guide

Updated 8 min read Gravity Forms Payments & Pricing
On this page
  1. Step 1: Install and License the Add-on
  2. Step 2: Connect Your Stax Account
  3. Copy your API key and Web Payments Token
  4. Choose the mode and save
  5. Step 3: Set Up Webhooks
  6. Step 4: Add the Stax Payment Field
  7. Step 5: Create a Stax Feed
  8. One-time payments (Products and Services)
  9. Subscriptions
  10. How Payments Are Processed
  11. Step 6: Refunds, Voids and Cancellations
  12. Test in Sandbox Before Going Live
  13. Developer Filter: Payment Token Age
  14. Troubleshooting & FAQ
  15. The form says “Online payment is not available right now.”
  16. The secure card fields do not appear.
  17. An ACH payment is still Pending.
  18. A refund fails with “Only full refunds are allowed”.
  19. Is 3-D Secure supported?
  20. Resource Hub

The Gravity Forms Stax Payment Premium Add-on lets your Gravity Forms take card payments, optional ACH bank payments and recurring subscriptions with Stax, while card details are typed into secure fields hosted by Stax. Refunds, voids and cancellations are handled from the entry screen.

System Requirements & Prerequisites

  • WordPress: Version 6.5 or higher
  • PHP: Version 7.4 or higher
  • Gravity Forms: Version 2.9 or higher
  • Stax account: An active Stax merchant account with access to Stax Pay, plus a Stax sandbox for testing
  • Currency: US dollars. Set Forms → Settings → Currency to U.S. Dollar
  • Bank payments (optional): ACH enabled on your Stax account
  • GravityExtra license: The Stax add-on installed, activated and licensed with an active GravityExtra license key

Step 1: Install and License the Add-on

  1. Go to Plugins → Add New → Upload Plugin, upload the add-on ZIP file and click Activate.
  2. Open Forms → Settings → Stax.
  3. Enter your license key in the Gravity Extra License section and save. The Stax settings appear once it is active.

Step 2: Connect Your Stax Account

Copy your API key and Web Payments Token

Each Stax account (sandbox and live) has its own pair of credentials. In Stax Pay open Apps → API Keys, create a new API key and copy it. On the same page, copy the Web Payments Token.

  • API key is secret. The add-on uses it on your server to verify and charge payments. It is stored in a masked password field and is never sent to the browser.
  • Web Payments Token is public. It loads the Stax secure card fields on your form.

Choose the mode and save

Mode starts on Sandbox (test payments, no real money), and the add-on stays in sandbox until you select Live and save. Paste the Sandbox API Key and Sandbox Web Payments Token first; you can leave the live fields empty for now.

When you click Save Settings, each API key is checked with Stax. A rejected key shows “Stax rejected this API key” and is not saved. A working key shows Connected to Stax merchant “Your Company” (gateway: …). You are warned if a sandbox key is not on a test gateway, or a live key is.

Stax settings in Gravity Forms in Sandbox mode with a masked sandbox API key, the Connected to Stax merchant message, Web Payments Token, ACH option and the webhook URL with its five events
Forms → Settings → Stax connected to a sandbox merchant, with ACH turned on and the webhook URL to copy into Stax Pay.

Tick Bank payments if you want customers to be able to pay by bank account (ACH). ACH has to be enabled on your Stax account as well.

Step 3: Set Up Webhooks

Webhooks keep entries in sync with Stax: subscription renewals, ACH settlement and refunds made in Stax Pay. The Webhooks section shows your webhook URL. In Stax Pay go to Settings → Webhooks, add that URL and select these events:

create_transaction update_transaction update_transaction_settled update_scheduled_invoice delete_scheduled_invoice

The URL contains a secret token, so keep it private. The add-on also reads each transaction or schedule back from the Stax API before it changes an entry, and ignores repeated deliveries.

Step 4: Add the Stax Payment Field

Edit your form and add the Stax Payment field from the Pricing Fields group, next to your product and total fields. One Stax Payment field per form is used.

Card data never touches your website

The card number and security code are typed into secure windows (iframes) served by Stax.js, so they go straight to Stax. Stax returns a one-time reference called a token, and only that token is posted to WordPress. The name, expiry date and ACH bank numbers are typed on your page but are sent only to Stax, never to your server. Ask Stax which PCI questionnaire (SAQ) applies to your account.

Gravity Forms payment form with billing address and the Stax Payment field showing Card and Bank account options, name on card, secure card number, expiration and CVV
The Stax Payment field with Card and Bank account (ACH) options. In Sandbox mode a test notice is shown above it.

With ACH on, customers can switch to Bank account (ACH) and enter the account holder name, routing number, account number, account type (Checking or Savings) and holder type (Personal or Business).

Step 5: Create a Stax Feed

Open the form, go to Settings → Stax and click Add New. Give the feed a name and pick a Transaction Type.

One-time payments (Products and Services)

Choose Products and Services and set Payment Amount to Form Total or a single product. The amount is always calculated on your server. Under Billing Information, map the email, phone, company and address fields so the Stax customer record is complete.

Stax feed for a one-time payment with Products and Services, Form Total and billing information mapped to email, phone and the billing address
A one-time feed charging the form total, with billing details mapped from the Email, Phone and Billing address fields.

Subscriptions

Choose Subscription to bill on a schedule. The first payment is charged when the form is submitted, and the following payments are created as a Stax scheduled invoice with autopay on the customer’s saved payment method.

Setting What it does
Recurring Amount A product or the form total, charged every billing cycle
Billing Cycle Every 1–365 days, 1–52 weeks, 1–12 months or 1–5 years
Recurring Times infinite (until cancelled) or 2–100 payments, including the first one
Setup Fee A product charged once at sign-up, together with the first payment
Trial period (days) 0–365 free days before the first recurring charge. A setup fee is still charged at sign-up
Stax invoice emails When ticked, Stax emails the customer an invoice or receipt for each renewal
Stax subscription settings with recurring amount, monthly billing cycle, infinite recurring times, setup fee, a 7-day trial period and Stax invoice emails
A monthly membership with a welcome-kit setup fee, a 7-day trial and Stax renewal emails.

If the scheduled invoice cannot be created after the first charge went through, the first charge is reversed, the customer sees an error and no entry is saved.

How Payments Are Processed

  • Card payments are charged right away and the entry is marked Paid.
  • ACH payments are marked Pending until Stax reports them settled, then Paid. A bank payment that is returned is marked Failed.
  • Declines show a clear message on the Stax field (“Your card was declined…”) and no entry is created, so the customer can try another card.
  • Double submissions are blocked: each payment token is charged at most once, and Stax returns the original transaction if a request is repeated.

Step 6: Refunds, Voids and Cancellations

Each Stax entry has a Stax Payment box showing the mode badge, status, payment method, transaction id, scheduled invoice id (for subscriptions), reference and any refunded total. To find it in Stax, search Stax Pay → Transactions for the transaction id.

Stax Payment box on a Gravity Forms entry with Sandbox badge, Paid status, Visa ending 1111, transaction id, reference and the Refund or void in Stax button
The Stax Payment box on a paid entry, with the refund amount and the Refund / void in Stax button.
  • Refund / void in Stax: enter an amount up to the remaining balance of the first charge and confirm. If Stax has not batched the payment yet, it is voided (full amount only). Once batched, it is refunded, and partial refunds are allowed. The entry status and notes update automatically. The button is available to users who can edit entries.
  • Cancel a subscription: use the Gravity Forms Cancel Subscription button in the Payment Details box. The add-on deletes the scheduled invoice in Stax.
  • Changes made in Stax Pay (refunds, deleted or completed schedules) are recorded on the entry through webhooks.

Test in Sandbox Before Going Live

Always run a few payments in the Stax sandbox first. Sandbox entries show a Sandbox badge.

  1. On the Stax test environments page, click Request a Sandbox and fill in the form.
  2. When your sandbox is ready, log in to Stax Pay and select the sandbox merchant in the merchant switcher (top right).
  3. Open Apps → API Keys, create a new key and copy it, then copy the Web Payments Token. Ask Stax to enable ACH on the sandbox if you plan to accept bank payments.
  4. In WordPress, keep Sandbox selected, paste the sandbox credentials and save. Check for the “Connected to Stax merchant” message.
  5. Add the webhook URL and the five events in the sandbox under Settings → Webhooks.
  6. Submit test payments with the cards below, a decline, a void and a short-cycle subscription.
Type Approved Declined
Visa 4111111111111111 4012888888881881
Mastercard 5555555555554444 5105105105105100
American Express 378282246310005 371449635398431
Discover 6011111111111117 6011000990139424
ACH (bank) Routing 021000021, account 9876543210 Any other account number

Sandbox refunds wait until midnight Eastern. Stax sandbox transactions can be voided the same day, but a refund (including a partial refund) is only possible after 12 am EST. Test a void on the same day and a partial refund the next day.

When everything works, paste your live API key and Web Payments Token, select Live and save. Add the webhook in your live Stax account too.

Developer Filter: Payment Token Age

For safety, the add-on only charges payment tokens created by Stax.js within the last 24 hours, so an old stored payment method id cannot be charged through your form. The gform_stax_payment_method_max_age filter changes that window in seconds (return 0 to turn the check off). This example allows tokens up to 2 hours old:

functions.php
PHP
// Only charge Stax.js payment tokens created in the last 2 hours
add_filter( 'gform_stax_payment_method_max_age', function( $seconds ) {
    return 2 * HOUR_IN_SECONDS;
} );

Troubleshooting & FAQ

The form says “Online payment is not available right now.”

The credentials for the selected mode are missing, the license is not active, or the form currency is not US dollars. Check Forms → Settings → Stax (both the API key and the Web Payments Token for the current mode are needed) and set the Gravity Forms currency to U.S. Dollar. Forms → Settings → Logging shows the exact reason.

The secure card fields do not appear.

The message “The secure payment form could not be loaded” means Stax.js did not load in the browser. Make sure no optimization or security plugin blocks or delays scripts from staxjs.staxpayments.com, and that the Web Payments Token matches the selected mode.

An ACH payment is still Pending.

Bank payments stay Pending until Stax sends the settlement webhook, which usually takes 1–3 business days. Make sure the webhook URL and the update_transaction_settled event are set in Stax Pay for the same account (sandbox or live).

A refund fails with “Only full refunds are allowed”.

The payment has not been batched yet, so Stax can only void the full amount. Void the full payment now or wait until the batch closes to issue a partial refund. Renewal payments are refunded in Stax Pay.

Is 3-D Secure supported?

No. Stax does not document 3-D Secure for this kind of integration, so the add-on does not use it.

Resource Hub

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