Documentation, Reference Materials and Tutorials for WPForms
Would you like to collect PayPal payments on your WordPress site? WPForms makes is super easy to integrate PayPal into your forms for order form payments, donations, and more.
In this tutorial, we will show you how to install and use the PayPal addon with WPForms.
- Install the PayPal Addon and Create a Form
- Add PayPal Payments to Your Forms
- (Optional) Set Up Conditional Logic for Payments
- Frequently Asked Questions
1. Install the PayPal Addon and Create a Form
Before we get started, be sure to install and activate the WPForms plugin on your WordPress site.
Once WPForms is installed, you can also go ahead and install the PayPal addon.
With the PayPal addon installed and activated, we’re ready to add PayPal to a form. To do this, create a new form or edit an existing form.
For this example, we’ll create a new form using the Billing / Order Form template. However, you can start with any form you’d like.
By default, the Billing / Order form template comes with the fields that you’d most often want in a payment form. If you’d prefer to include less fields, however, PayPal needs only one field to work properly: an items field (which could be a Single Item, Multiple Items, or Dropdown Items field).
Even with more than one items field, a Total field is not required for PayPal to work. However, including a Total can be helpful for users to easily see how much they’ll be paying.
2. Add PayPal Payments to Your Forms
Now that your form is created, the next step is to connect it to PayPal.
With the form builder still open, go to Payments » PayPal Standard. Here, you’ll need to check the box labeled Enable PayPal Standard payments.
Here are the additional PayPal settings to fill out:
- PayPal Email Address: The email for your PayPal account, where payment will be sent
- Mode: Options are Production or Test / Sandbox
- Payment Type: Options are Products and Services or Donation
- Cancel URL: If users don’t complete payment on PayPal, this is the URL they’ll be redirected to
- Shipping: If you’re shipping a product to the user, you can choose to ask for and require an address field during PayPal’s checkout process
Additionally, there are two checkbox options at the bottom of these settings. The first is Don’t ask buyer to include a note with payment. If you don’t need users to add a note in the PayPal checkout, you can check this box to disable it.
The second checkbox is to enable conditional logic. This is useful if you’d like to let your users choose between paying with Stripe or PayPal in your form.
When you’re ready, be sure to click on the Save button to store your payment settings.
3. (Optional) Set Up Conditional Logic for Payments
WPForms’ PayPal addon settings also include the option to set up conditional logic. Conditional logic allows you to create “smart forms”, automatically changing content or behavior in the form based on a user’s selections.
There are many ways you can use conditional logic with PayPal payments, for example:
To set up conditional logic for PayPal payments, you’ll need to open the form builder and go to Payments » PayPal Standard. Under the options you set up earlier, check the box labeled Enable conditional logic.
Once this box is checked, some additional options will appear. Within these options, you’ll be able to set your rule(s) about when the user should be sent to PayPal to complete the payment process.
The options will include:
- Process: Determine what should happen if the conditions that you set up are met (options include Process and Don’t Process).
- Select Field: Choose the field within your form where you’d like to apply this rule.
- is: Choose the type of comparison you’d like to use (options include is, is not, empty, not empty, contains, does not contain, starts with, ends with, greater than, and less than).
- Select Choice: Determine what value you’d like the field to contain in order for this condition to apply.
As an example, let’s set up some logic to only run a PayPal payment if the user chooses to sign up for our workshop.
First, we’ll add a Dropdown Items field that will be used in our conditional logic rule. In this field, we’ll let users choose whether or not they’d like to sign up for the workshop.
After setting up this field and going to Payments » PayPal Standard, we’ll check the box to Enable conditional logic.
We’ll only need to process a payment if they do choose to sign up. To configure the rule for this, we’ll set the dropdowns to read: Process this charge if Would you like to sign up for our workshop? is set to Yes, sign me up!
Now when a user submits this form, they’ll only be taken to PayPal if they choose to sign up for our workshop.
Frequently Asked Questions
How do I test PayPal payments in my forms?
The best way to test out your forms is to submit an entry and follow the same steps as your users. We recommend setting up PayPal’s Test Mode before adding your form to a live page, which allows you to test transactions before accepting actual payments.
What happens when a PayPal payment form is submitted?
When a user submits a form with PayPal integration, they will immediately be taken to the PayPal website to complete payment.
At the same time, the form’s notification emails will be sent as soon as the form is submitted.
How do I know when the user completes their payment on PayPal’s site?
Until the PayPal payment is completed, the Entries page will display a Pending status for that entry. Once payment has been made, this status will change to read Completed.
That’s it! You’re now able to add PayPal payments in WPForms.
Would you also like to send different notifications to your users based on their selections in the form? Check out our tutorial on conditional notification emails for all the details.
- Fixed: Processing empty payments.
- Changed: IPN callback URLs to new URLs PayPal recommends (previous ones are being deprecated/removed).
- Changed: Processing hook order (decreased priority) to avoid conflicts with the User Registration addon.
- Added: Donation payments include description from payment items
- Changed: All HTTP requests now validate target sites SSL certificates with WP bundled certificates (since 3.7)
- Fixed: Email validation issue by converting all email addresses to lowercase first
- Added: New hook for completed transactions,
- Added: Support for Dropdown Items payment field
- Added: Expanded support for additional currencies
- Changed: Removed setting to disable IPN verification
- Changed: Improved IPN verification
- Fixed: Localization issues/bugs
- Changed: Multiple payment items now also include label of selected choice in item description
- Changed: PayPal BN code
- Added: Conditional logic for payments
- Changed: Improved error logging
- Changed: Prevent plugin from running if WPForms Pro is not activated
- Changed: IPN setting has been moved to the new "Payments" settings tab
- Fixed: Issue with donation transaction types
- Fixed: Issue posting to PayPal due to incorrect URL
- Initial release.