BTCPay

Collect one-time Bitcoin and Litecoin payments on Gravity Forms through your own BTCPay Server. Funds go to the wallet you configure in BTCPay, and each submission is recorded as a Gravity Forms payment.

Overview

The Gravity Forms BTCPay Add-On connects a form to a BTCPay Server store so you can accept one-time Bitcoin and Litecoin payments. Use a server you host yourself or one hosted for you. The add-on creates the invoice and sends the customer to the BTCPay checkout. BTCPay handles addresses and payment confirmation, and the funds settle in the wallet configured on that store.

A payment feed sets the amount and the methods offered for that form. Choose from the methods already enabled on the store, such as Lightning, on-chain Bitcoin, LNURL, and Litecoin. You can also map buyer details and optional invoice metadata, including an order ID, a comment, and the receipt title and description shown on the BTCPay receipt.

After the customer pays, BTCPay notifies the site and the entry is updated. Statuses include Pending, Confirming, Partially Paid, Paid, Failed, and Cancelled, so the original submission and the payment stay together in Gravity Forms.

Key Benefits

  • Accept one-time Bitcoin and Litecoin payments on any form with pricing
  • Send customers to a BTCPay Server checkout
  • Keep funds in the wallet configured on your BTCPay store
  • Connect with a store-scoped API key, without sharing a seed or private key
  • Offer Lightning, on-chain Bitcoin, LNURL, and Litecoin when those methods are enabled on the store
  • Charge a form total or another mapped payment amount
  • Map buyer name, email, phone, and address to the invoice
  • Map an order ID, comment, receipt title, and receipt description
  • Update the entry as the payment moves through Pending, Confirming, Partially Paid, Paid, Failed, or Cancelled
  • Use conditional logic to control when the payment feed runs

How It Works

In WordPress, open Forms → Settings → BTCPay. Enter your BTCPay Server URL and choose Connect with BTCPay Server. Approve the API key for the store you want to use. The add-on registers a webhook and shows the server, store, API connection, and webhook status.

Turn on the payment methods this site should offer. Only methods enabled on the BTCPay store can be selected here.

Edit a form that has a product and a total, then add a BTCPay feed. Under Payment Settings, set the payment amount and choose which methods this feed accepts. Optionally map billing information and invoice metadata. Order ID defaults to the entry ID when left unmapped.

When the form is submitted, the add-on creates a BTCPay invoice and redirects the customer to checkout. BTCPay sends the result back to the site, and the entry payment status is updated to match.

Provide feedback here

Requirements

  • WordPress with Gravity Forms 2.9.24 or later.
  • PHP 8.0 or later.
  • A reachable BTCPay Server instance (HTTPS) with Bitcoin — and optionally Litecoin — enabled, and a wallet configured (ideally a watch-only xpub/zpub derived from a hardware wallet).

Changelog

0.1.0-alpha.1

  • First alpha release of the Gravity Forms BTCPay Add-On.
  • Accept one-time Bitcoin and Litecoin payments through a BTCPay Server checkout.
  • Fixed a plugin-settings save clearing the BTCPay connection. The connected screen does not post the API key, and saving replaced the stored credentials.
  • View more

Changelog — gravityforms/gravityformsbtcpay

0.1.0-alpha.1

  • First alpha release of the Gravity Forms BTCPay Add-On.
  • Accept one-time Bitcoin and Litecoin payments through a BTCPay Server checkout.
  • Fixed a plugin-settings save clearing the BTCPay connection. The connected screen does not post the API key, and saving replaced the stored credentials.
  • Fixed completed-payment notes recording a blank amount. The charged amount is saved when the checkout is created and used when the payment is marked paid.
  • Renamed the feed's one-time payment section to Payment Settings.

Documentation

BTCPay Add-On Documentation


Connect a BTCPay Server, create a payment feed, and collect a one-time Bitcoin or Litecoin payment.

Connect BTCPay Server

  1. In WordPress, open Forms → Settings → BTCPay.
  2. Enter your BTCPay Server URL and click Connect with BTCPay Server.
  3. Approve a store-scoped API key on BTCPay. The add-on registers the payment webhook and stores its secret.
  4. The Connection Status section confirms the store connection and that the webhook points at this site.

Connection status with the server, store, verified API connection, and registered webhook

The Labs notice on this screen is expected. This add-on is not officially supported.

Configure the wallet inside BTCPay Server. The add-on never asks for a seed, private key, or xpub.

Enable payment methods

After the connection succeeds, Payment Methods lists the methods enabled on the BTCPay store. Turn on the ones this site should offer. A method that is off in BTCPay cannot be turned on here.

Payment methods with Lightning, on-chain Bitcoin, LNURL, and Litecoin enabled for the site

Create a payment feed

  1. Edit a form that has a product and a total.
  2. Open Settings → BTCPay → Add New.
  3. Name the feed and leave the transaction type on Products and Services.
  4. Under Payment Settings, set the payment amount and choose which site-enabled payment methods this feed offers.

Payment Settings with Form Total selected and Bitcoin and Litecoin methods checked

  1. Optionally map invoice metadata. Order ID defaults to the entry ID when left unmapped. Receipt Title and Receipt Description are shown on the BTCPay receipt.

Invoice metadata with Order ID, Comment, Receipt Title, and Receipt Description unmapped

  1. Optionally map billing fields. Mapped buyer details are sent to BTCPay with the invoice.

Billing Information with Name and Email mapped

Subscriptions are not available. The transaction type stays on one-time products and services.

After the customer pays

Submitting the form creates a BTCPay invoice and sends the customer to the hosted checkout. Funds go to the wallet configured in BTCPay Server.

BTCPay sends a signed webhook back to the site. The entry payment status becomes one of Pending, Confirming, Partially Paid, Paid, Failed, or Cancelled. The first time a feed is saved, the add-on adds a Payment Confirming confirmation for customers who return before the payment confirms.