How to Add Optional Payment to Your WordPress Forms

Do you want your visitors to be able to choose to donate to your nonprofit as they’re filling out a form? Using conditional logic, you can hide fields unless the user chooses a certain option. In this article, we’ll walk you through how to add optional payment to your WordPress form.

Adding Form Fields

The first thing you need to do is install and activate the WPForms plugin. Here’s a step by step guide on how to install a WordPress plugin.

Also, you’ll need to have a form created. See our tutorial on How to Create a Simple Contact Form as an example to get started. You can use any kind of form, but for this tutorial we’ll be using a contact form.

The default contact form comes with Name, Email, and Comment or Message fields. We need to add the Multiple Choice, Credit Card, and Single Item fields to the form.

WPForms is the best WordPress Form Builder plugin. Get it for free!

Looking to accept payments on your site? Read about if the Jetpack Simple Payment Button is the right solution for you.

Customizing Form Fields

The Multiple Choice field comes with three choices but you only need two choices for optional payment. You can simply remove the third choice by clicking on the field in the right panel to edit and then deleting the third choice in the left panel.

optional payments

Since you’ll going to be asking your visitors if they would like to donate, it’ll be a good idea to change the labels for the multiple choice. You can do so by simply clicking on the multiple choice field in the right panel to edit and changing the labels in the left panel.

donation fields label

Make sure to read our post on the best Stripe payments plugin for WordPress.

The Single Item field needs to be set to User Defined so users can enter in their own donation amount. You can do this by configuring the advanced settings for the Single Item field.

user defined

If you need help customizing the donation amounts, you can read this article on how to create a donation form with multiple amounts.

Enabling Conditional Logic

To add optional payment to your form you first need to enable conditional logic. You can enable it by clicking Credit Card » Conditionals » Enable Conditional Logic.

Optional Payment Settings

Once you have enabled conditional logic, you’ll need to configure the settings of when you want the payment option to show up for your users. For a nonprofit donation, you want the payment field to only show up when the user clicks “Yes, I want to donate”.

Did you know your organization can apply for the WPForms Nonprofit Discount?

Lastly, you need to connect to your payment provider by clicking on the “Payments” tab on the left side.

WPForms integrates with both PayPal or Stripe for accepting payments. You can even use set up your form to allow users to choose a payment method.

In this example, we will set up PayPal to process orders. To do this, you first need to install and activate the PayPal addon.

Simply go to WPForms » Addons and click on the install button for PayPal Addon. Once activated, you need to return to your form to configure the PayPal settings.

enable paypal payments

You need to enter your PayPal email address, make sure the mode is in Production and adjust other settings as needed.

If you want to see your website’s income skyrocket, be sure to take a peek at our list of the best WordPress popup plugins.

After you are done configuring the order form settings, click Save to store your changes and your form is ready to be published on your site.

That’s it! You’ve just added optional payment to your WordPress form.

Want to accept payment for the online orders? Check out how to process payments with your WordPress orders forms.

If you’re looking to save even more time processing online orders, you can check out our tutorial on how to create a client booking form that connects with your calendar software.

What are you waiting for? Get started with the most powerful WordPress forms plugin today.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.

Comments

    1. Hi Sharukh,

      We don’t currently have integration with Instamojo, but we’ve added that to our feature request list for future consideration. Thanks for the suggestion 🙂

    1. Hi Kevin – We don’t currently have an option for this integration, and are focusing on our current payment options (Stripe and PayPal). But I’ve noted this on our feature request list for consideration down the road 🙂

  1. How can I export information on paypal form.
    I need the status field information.
    What other transaction fields related to paypal can I get access to export or use in wpforms
    Iike transaction #, Paid amount, or the field status -completed or pending, anything…

    Trying to build report with exported information, I export now and no status field.
    Thank you

    1. Hi Eric,

      I apologize for any trouble with this, and the reason that we don’t include this information in CSV exports is that it’s generated dynamically (pulled from PayPal so that you see the latest/most correct info). I can understand why this and the other PayPal-related data would be useful to export, though, and I’ve added that to our feature request to be considered down the road.

      If we can assist in any other way, please get in touch!

  2. Is this possible to integrate payment gateway other than PayPal or stripe in wpforms? In india both the gateways are not popular.

    1. Hi Prashann,

      We currently only have payment integrations with Stripe and PayPal, and aren’t planning to expand this in the near future. But if you could please share any options that you were hoping for over in our feature request form, that will help us to keep additional ideas in mind down the road.

      Thanks! 🙂

      1. I agree with him both this option does not work with India and I am also looking for some better option integration with WP forms that we can use for india for payment please let me know if you have something come up in that matter

      2. Hi Beena,

        We really appreciate your feedback and while I’m sorry we currently don’t have any other payment integration options available I’ll go ahead and forward your comment as a feature request to our team for them to consider as they plan future updates to WPForms.

        Thanks!

    1. Hi Ali,

      We don’t have a way to do this right now, but I’ve made a note on our feature request list so we can keep it on our radar! Thanks for the suggestion 🙂

    1. Hi Desmond,

      We don’t have a way to do this right now, but I’ve made a note on our feature request list so we can keep it on our radar! Thanks for the suggestion 🙂

    1. Hi Lucas,

      Currently we don’t have the ability to include coupon codes in our forms. We do have a possible workaround to set this up as shown in this screencast.

      But essentially, you can add two Multiple Items fields — one with normal pricing and one with discounted pricing and also add a Single Line Text field to accept a coupon code. The last step is to create conditionals for each of the item fields. To do this, click on one of those fields and open its Field Options screen. From there, open the Conditionals section and checked ‘Enable Conditional Logic’.

      For the full price items, the logic should resemble this screenshot. This tells this field to be hidden if the correct coupon code is entered.

      The discounted item’s conditional logic should be set to display when that same ‘coupon code’ is entered.

      I hope this helps! 🙂

  3. Please Add Paystack Payment Gateway. I unable to complete my form submission PayPal and Strip don’t work in my Country..
    Please help!

    1. Hi SamuelChuck,

      At this time we only support Stripe and Paypal Standard, and will be concentrating on those two payment providers. I’ll make note of your suggestions so we can review it later as we continue to plan out our roadmap for the future. We appreciate the suggestion!

  4. Hi am Dan
    Just want to know can I use the wf plugin to design Electricity bill payment and transportation bill payment system? Am new as a CMS user.

    1. Hi Daniel! You can absolutely create a simple payment form with WPForms. We have a great article on our website about this here. Hope this helps!
      Have a good one 🙂

  5. As far as I can tell, this doesn’t actually work with Stripe. I’m a WPForms Pro user and have tried to set this up, but if you try and submit a form that has a total value of $0 then you get an error from Strip saying “invalid amount”.

    1. Hi Daniel.
      This should work if you will use Conditional logic under Payments > Stripe settings in the form builder.
      For example, you can set it up there so the Stripe payment won’t be processed if an Item with “0” price is chosen, or based on the choice in a Checkbox, Multiple Choice, Dropdown, etc field. This way you can simply disable Stripe payment in your form if the payment conditions are not being met.
      I hope this helps.
      Have a good one 🙂

      1. You’re right. That does work. But that’s a pretty crucial step in the process that is entirely missing from this tutorial! Without that step, it doesn’t work. The tutorial mentions using conditional logic to display the payment form, but doesn’t mention the need for the additional steps on the Payment tab. It’s not intuitive that you would need to do this. As far as I’m concerned, if there’s no way to enter a credit card in the form, why would it be trying to process a payment?

      2. Hi Daniel,
        thanks for taking the time to write to us about this. I will forward this to the post author so they can possibly make some edits to more clarify the process.
        And regarding your question, the system will still think that the Payment should be processed if it is not disabled conditionally.
        I apologize for any inconvenience!
        Have a good one 🙂

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.