Accept Payments via PayPal using Contact Form 7 WP Plugin – FREE

You can easily direct users from your contact form to PayPal.com when the user/customer clicks the submit button.  Such cases arise when you have an online business where the customer has to provide details about the order.  I was in a similar situation in the past 2-3 days when I was adding functionalities to my design website where I provide Logo Design Services.

The best is that the users/customers can make payments via their credit card as well. For that you will have to create Paypal payments links which you will use  in your contact form 7 additional settings.

What do you need to Integrate Paypal payments with your contact form?

  1. Paypal Payments links – This link will take you to Paypal button designer page
  2. Contact Form 7 Plugin for WordPress

There are premium premium plugins out there but in my opinion if you can get everything for free then why waste money ?  Just a simple line of code will do the trick for you.

How to Create Paypal Payment Links or Buttons ?

  1. Visit Paypal Button Designer page and create a button as per your requirements
  2. Once you create the button, you will get the button code. Please select email instead of button on the tabbed widget
  3. Copy and save the link in a notepad

Paypal email payments

Installing Contact Form 7

  • Learn how to install and use contact form 7 by watching this video http://www.youtube.com/watch?v=jPVDfjeyvfI
  • Go to contact form settings in your WordPress dashboard
  •  Add a new form and design it as per your requirements
  • Scroll down to Additional Settings
  • Add the below code and save changes
on_sent_ok: “location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PUT YOUR BUTTON ID HERE‘;” 

If the above code doesn’t work, Please try this one.

on_sent_ok:"location.replace('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Enter_Your_Buy_Now_ButtonID_here');"

Paypal and contact form integration

  • Now whenever a user clicks on the submit or send button, It will direct them to Paypal for making payments.

You can also watch my video tutorial :

I hope this tutorial was easy and simple to understand. I would appreciate if you comment below. Thanks a lot for your time and patience.

Author: Anish Sangamam

My bio goes beyond Studies, More precisely, I am a Part time blogger. My mission is simple, To connect with people and to help them.

Share This Post On

14 Comments

  1. Hi,
    I followed the steps as stated in your tutorial. But my form never gets redirected to the paypal website after I clicked the submit button. The page didn’t even show the message to say that the message has been sent succcessfully. However the form was indeed submitted.
    Any advice will be most appreciated!

    Thanks!

    • It just works fine for me.

      on_sent_ok:”location.replace(‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=add_your_button_id_here’);”

  2. Hi again,

    I just found out that using location function works and not location.replace.

  3. Unfortunately neither one seems to works for me. I tried the replace and then with function. Any updates ?

  4. las comillas que estas usando no son las que corresponden!!!!
    este código me sirvió:

    on_sent_ok: “location = ‘http://example.com/’;”

  5. It didn’t work, so I tried the url from Heidi E Hafner: on_sent_ok: “location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=[PUT YOUR BUTTON ID HERE]’;”
    and It works

  6. Looks interesting, definitely worst try. I am going to try this for sure.
    Thanks for sharing useful article.

  7. Hi there,

    I am building a website for my old man as a gift to help him with his business.

    I’m using CF7 to place an order for 1 of 4 items available which I have set up individual paypal buttons for.
    Below is the code I put into the ‘Additional Settings’ Field at the bottom of the editing page for my CF7 form within the dashboard.
    I need the form to redirect to each of the 4 respective items dependant on the number in the spinbox which has only 1 – 4 available.

    ‘number-426’ is a number field spinbox which is tag: [number-426] on my CF7 Form editing page and the hosted button id’s are just dummies as I don’t want to give the real ones to all readers.

    on_sent_ok: “if (document.getElementById(‘number-426′).value==’1’) {
    location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ABC’;
    } else if (document.getElementById(‘number-426′).value==’2’) {
    location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ABCD’;
    } else if (document.getElementById(‘number-426′).value==’3’) {
    location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ABCDE’;
    } else {
    location = ‘https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ABCDEFG’;
    }”

    I’ve been at this for hours and would be very grateful if anyone could shed some light on why it isn’t working and how to make it do so.
    Thanks heaps in advance 🙂

  8. Hi,

    How do you get the email option with Paypal?

Submit a Comment