Money

How to Build a Donation Form with Gravity Forms

| 13 Comments

Accepting donations online is typically something required by non-profit organisations, but another group of people that could benefit from it is plugin and theme developers for instance, accepting donations for the hours of free work they’ve put into their open-source products.

I was recently building a website for a church and they wanted to create an online donations page, where people could either make a single donation, or create a recurring donation as part of their tithe.

Install Gravity Forms

The first order of business is to purchase and install Gravity Forms. If you don’t yet have a license, you’ll soon to come to realise how useful it is and how quickly it pays for itself. It’s an immensely powerful plugin that beats any other form-building solution (this being a prime example) and it’s what I’ll be using in this demonstration. Once you’ve installed it, be sure to also install the PayPal add-on (you can do this by going to Forms > Add-ons).

Configure PayPal

First of all, you need to configure PayPal so that it sends its Instant Payment Notifications back to your WordPress installation to confirm payment. Go to Forms > Settings and click on the PayPal tab at the top of the page. It will give you specific instructions for how to do it for your site (each site will have its own unique address to configure).

Build the Form

Create Donation Field in Gravity FormsNow you need to build your form. Create a new form and enter an appropriate title and description. Then, under the Pricing Fields, add a Product field and set the field type to User Defined Price. You can instead use Radio Buttons to allow the user to select from pre-determined donation amounts. This is the same process whether you’re creating a form for a one-time donation, or a recurring donation.

If you want to collect the name, email and/or address from the donor, add those fields as well – Gravity Forms is clever enough to pass that information on to PayPal too.

Once you’ve built the form, save it.

Connect it to PayPal

Now navigate to Forms > PayPal and click on Create a New Feed. This will allow form submissions to be “fed” to PayPal.

Enter the email address of the PayPal account and set the mode to Production (unless you want to do some testing). The Transaction Type will depend on whether this is a one-time donation, or a recurring donation. If it’s for one-time donations, then select Donations. Otherwise, choose subscriptions for recurring donations.

Recurring Donations in Gravity FormsIf it is a recurring donation, you’ll be prompted to enter the terms of the donation, such as the frequency, whether there is a “free trial period” (not usually applicable for donations) and the form field that contains the donation amount.

Select the form from the drop-down that contains your donation form and if applicable, enter the fields which contain the name, email and address of the donor. Then complete the rest of your options and save the Feed. Note that you can create a PayPal condition, which means that only under certain conditions will the form be sent to PayPal. If it’s disabled (default), all entries will be sent to PayPal.

You can also use this to create a donation widget, since you can add Gravity Forms to your sidebars in widgets. Just another reason I love Gravity Forms.

Now go to your form and perform a test. When you hit submit, you should be sent to PayPal to complete the donation. What kind of sites have you used this on?

Get Started

Categories: Plugins | Permalink

What next?

Hire me

If you couldn't quite manage this yourself, find it too intimidating, or just don't have the time to do it, you can always hire Dave to do it. Please get in touch so that we can discuss your needs.

Leave a comment

If you have a question, update, or comment about the tutorial, please leave a comment. I try and respond to every comment, though it may take a few days, so please check back soon.

Let a WordPress Expert help you

Do you want to try this, but feel like you need a helping hand, in case something goes wrong? My service, The WP Butler, gives you access to WordPress expertise whenever you need it. Better yet, I'll keep your site backed up, updated and secure, so that you don't have to worry about it. It's all part of the service. Use coupon DIWW and save 15% on all plans.

Visit The WP Butler

Author:

Dave has been tinkering with WordPress for many years, and he now shares his WordPress knowledge here on Do It WIth WordPress to help others realise its impressive power. He can also be hired to help with your WordPress needs. Dave, who is British, is married to his best friend, Marti, with whom he has a beautiful daughter, Ellie. When he's not dabbling with WordPress, he's probably eating Triscuits or hummus, watching an indie film or British TV show, spending time with friends or family, or exploring the world.

13 Comments

  1. What a great tutorial. I’ve been using Cforms II for most of my forms. I’ve looked at Gravity before, but based on this tutorial, I’ll be switching over to Gravity and ditching Cforms.

  2. I have often wondered whether a donation form is worth it because I have never donated but I guess there is only one way to find out and that is to try it. This looks like and easy way to give it a go, thanks for posting.

    • Well, that depends on the application. I wouldn’t have one on my blog for instance, unless I had some big plugins that I was giving away for free, but for charities, it’s useful. But that’s not to say that you can’t; I’d be interested to hear how it goes.

  3. We’ve used gravity forms for a long time, and I’ve seen the e-commerce feature (but never used it). I think this a great way to use that feature. I haven’t seen seen the donation model used as nearly as much as it should be.

  4. Great post. I followed your steps above and I got this warning message from GF. I was wondering if you had this issue as well.

    “The form selected does not have any Donation fields. Please add a Donation field to the form and try again”

    • When did you encounter that issue? Did you set the form up as described in this tutorial?

      • I finally got it resolved. I did not update the Paypal add-on to the latest version. I wasn’t aware of it until I logged into support. Thanks for responding. It works just fine now.

  5. Thanks for this info.
    I set things up the way you explained. All worked well, except for the very last stage.
    Paypal simply returns the user to the page from which the transaction came. The transaction does not appear as complete in the back end. Rather, it comes up as “Processing”.
    What settings did you use in the Confirmation settings on the form you set up?

    Thanks,

    Joe

  6. Thanks for your straightforward post! One question: do you need an SSL certificate for your site in order for this method of enabling PayPal donations to work securely?

Leave a Reply