I use the Contact Form 7 plugin (created by Takayuki Miyoshi ) for all my WordPress websites. I love how easy it is to work with and create forms.
The other day, I was throwing together a form to offer some web security for my clients. I wanted to have a web form that would allow them to give all pertinent information and include payment. However, I had a tough time figuring out how to do that. I searched all over the Internet for any way to work this out and finally came across some information that I thought might help. But it was not complete. Finally, I fiddle around with my form and the ideas I had come across on the Internet. The result works well, so I thought, perhaps I should write a little tutorial in case there are others who might be confused.
Let’s assume for the sake of time, that you have your form all set up except for the PayPal part. We’ll move from there.
In order to integrate PayPal into Contact Form 7, you need a PayPal button. To get that, you need a PayPal account.
Go into the Merchant Services and create your button as if you were going to add this button to your website. I made mine a Buy Now button because it is a service I am offering. Make sure you make your button complete. If you need to customize your button with some advanced features, such as dropdown menus, you would do that at this point.
You may not know this, but you can change where Contact Form 7 redirects after submission. All you need is a URL. So, let’s look at what we need from the PayPal button.
When you save your button, you are sent to the page that has the code for your buttons. The URL needed for this procedure is on the “Email” tab. Copy the whole URL, including the id number.
Now, let’s jump back to our contact form. Down toward the bottom of your contact form management page is a section labeled, “Additional Settings.” Take that URL that you copied and paste it in the box supplied.
on_sent_ok: "location = 'http://example.com/';"
Thank you for visiting my blog. I hope this little tutorial has helped you in some way. Please leave me a comment below.