Using PayPal For Event Registration Forms

Sometimes churches and organizations need to use a sign up form for an upcoming event, but aren’t exactly sure how to integrate PayPal with their favorite WordPress form plugin so they can take payments along with registrations. I’m a huge fan of Gravity Forms, but there is no built in support for PayPal as of yet, so here’s how I use it along with PayPal for event registrations. If you have another favorite form plugin, please feel free use it instead.

Merchant Services - PayPal

First we need to set up our button with PayPal. You can do this by going to your PayPal account and selecting merchant services as in the picture above or you can use the code below as a template for your button. This code is set to work around your PayPal email address which can have its advantages if you are unable to use the protected version for some reason or another. I’m including this code in a fund-raising section of a new theme I’m developing for non-profits called Agency.


<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

	<input name="cmd" type="hidden" value="_xclick" />
	<input name="business" type="hidden" value="me@myemail.com" />
	<input name="return" type="hidden" value="n=http://www.yoursite.com/registration-paid" />
	<input name="item_name" type="hidden" value="Registration Fee" />
	<input name="amount" type="hidden" value="20" /> 

	<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=me@myemail.com&currency_code=USD&amount=20&return=http://www.yoursite.com/registration-paid&item_name=Registration+Fee" target="paypal">Pay and register here.

</form>

Here’s a quick run down of what to change in the code. In the second input line, use your email address that is registered with PayPal. The third input line has a very important field, the return URL after someone has completed payment. This is where we will place our registration form. The Fourth input has the name of the item that will be displayed at PayPal.com when someone is paying. The last one is the amount that they will be charged. The last bit of the form is a link that also contains copies of these elements that we’re sending to PayPal.

Once you have your button created, then you will need to insert it into the page or post where you want people to start the registration process. Since all they will see is a text link, you can place this just about anywhere. You could easily include it into a text widget so it could be on every page or post in your site with minimal effort.

Now that your payment link is set, you need to create the page or post where the registration form will go. First we create a new form in Gravity Forms using their visual editor to quickly add the fields we need like name, address, phone number, email address plus anything we need for the registration like a spot for special requests or comments. Once we have the form set up, we go to the page or post where we’d like to use this form and insert it there. Once thing we will want to take care of is to make the URL is not easily guessed. We don’t want people accessing this page or post without first going through PayPal. You can change the “slug” or the end of the URL by clicking just below the title of any WordPress page or post and entering pretty much anything you want. You can shoot for a series of letters and numbers to make it difficult to randomly guess. Just make sure you place this URL into your purchase button and you’ll be set.

So now we have a purchase link that when clicked, takes someone registering to PayPal to pay for the event, and upon successfully paying, they are returned to our registration form where we can collect their information. It’s that easy. I would suggest checking the registrations against the collected payments just to make sure no one slipped through without paying, but you should be pretty secure.

If you’ve found any helpful methods to use your contact form, share them with us in the comments.

5 Comments

  1. Seth Shoultes
    July 26, 2010

    Why not just use the Advanced Events Registration plugin for WordPress.

    http://wordpress.org/extend/plugins/advanced-events-registration/

    Its an all in one solution for event registration and management with support for PayPal and Authorize.net.

    • Bill Robbins
      July 26, 2010

      You absolutely can use an events registration plugin for this. If you will be hosting many events that’s the way to go for sure. However if you only have paid events occasionally, this is a good way to accept payments without having to add another plugin. Plus this method will work for other scenarios where you need to accept payment and have a form filled out. I recently helped a literary blog accept payments for a short story contest they were running using Gravity Forms. Good comment Seth and good luck with your plugin. Some of my clients do lots of events, so I’ll be sure to check it out.

  2. Mike Hickerson
    August 26, 2010

    Thanks for this code, Bill! I’ve been using Jotforms for their PayPal integration, but I’m getting tired of the $10/month subscription. I knew there had to be a way to go directly from a form to PayPal, but I hadn’t had time to figure it out yet.


Mentions Of This Post

  1. [...] This post was mentioned on Twitter by Carl Hancock, Bill Robbins. Bill Robbins said: Using PayPal and any WordPress contact form for event registrations. http://bit.ly/9HDSjS [...]

Leave a comment




Enter your username and password to access the Organized Themes customer area