In this tutorial I will be showing you how to create a form with Gravity Forms that will allow your users to select between making a one-time and recurring payment. This is a variation of a conditional payment form.
Use Case
I see these types of forms used most often for donation type payment forms. Allowing the user to make a one-time donation or to make their donation an automatic recurring donation.
For the purposes of this tutorial, we will be building a form to collect donations for a fictional charity.
Prerequisites
- Gravity Forms Pro or Elite License
- Your Payment Accounts Setup (i.e Stripe, Square, PayPal)
- The Gateway Add-On(s) installed and connected
Note: I will not be showing you how to setup your Payment accounts or how to setup the individual gateway add-ons. If you are using Stripe I have a tutorial for that here!
The Gravity Forms doc site does have detailed tutorials on how to setup the gateway add-ons and I have linked to three of the most popular, however I will only be using Stripe for this demo:
Part 1: Creating your Form
You can have as many fields as you want or need for your form, however the fields below are required for this to work.
- Product Field
- Choice Field (i.e radio button or dropdown)
As previously mentioned, I am going to be using the Stripe Add-On in this demo, however the process is almost identical regardless of the payment add-on you choose to use.
Step 1: Setting Up The Form
- Go to Forms > Add New
- Give your form a name
- Add your desired fields (don’t forget the required fields)
- Click Update to save your form
Part 2: Creating Your Payment Feeds
Because you are giving the user the option select whether they want to make their donation a one-time or recurring donation, you will need two feeds.
Step 1: Setup a feed for the one-time donation:
- Go to Form Settings > Stripe
- Click Add New
- Name your feed
- Select “Product and Service”
- For “Payment Amount” select either the product or Form Total
- Map your Gravity Forms fields with the payment gateway fields
- Under “Other Settings” we’re going to Enable Conditional Logic
- Configure the logic to Process this feed when One-Time Donation is selected
- Click Save Settings
Step 2: Setup a feed for the recurring donation:
- Go to Form Settings > Stripe
- Click Add New
- Name your feed
- Select “Subscription”
- For “Payment Amount” select either the product or Form Total
- Map your Gravity Forms fields with the payment gateway fields
- Under “Other Settings” we’re going to Enable Conditional Logic
- Configure the logic to Process this feed when Monthly Donation is selected
- Click Save Settings
Part 3: Testing
You will want to test your form before publishing it for your users to start making donations.
The nice thing about most payment gateways, and the payment Add-Ons built by Gravity Forms is the ability to put your form into Test Mode so that you can run transactions without the need to actually charge your credit card.
The Wrap Up
You should now have the knowledge you need to setup your own conditional donation form to allow your users to make a one-time or recurring donation.
You can also add other conditional options to the form like the option to pay with credit card (using Stripe) or PayPal. You could also give the user the option to pay online or send a check.
You can learn more about that in this tutorial: Conditional Payment Options and Gateways with Gravity Forms
If you have any questions or need additional assistance, please use the comments or chat below!