Setting Up Conditional Logic for Stripe Payments

Stripe Pro Addon is a Pro Feature

Unlock Stripe Pro Addon and other powerful features to grow your business.

Get WPForms Pro

Looking to add flexibility to your payment forms? Using conditional logic with the WPForms Stripe Pro addon allows users to choose payment methods, toggle between one-time or recurring payments, opt for payment flexibility, and more.

This tutorial will show you how to use conditional logic with the Stripe Pro addon for WPForms.

Requirements:


Before you get started, be sure to install WPForms on your WordPress site and verify your license. Then install and activate the Stripe Pro addon.

Note: Stripe applies a 3% transaction fee to each payment processed through their platform if your WPForms license is inactive.

Setting Up Conditional Logic for Payments

The Stripe Pro addon supports conditional logic, which lets you create “smart forms” that automatically change based on a user’s selections or input.

There are many ways you can use conditional logic with Stripe payments, such as:

Note: For more general information on using smart logic in your forms, be sure to check out our introduction to conditional logic.

Below, we’ve walked through how to set up conditional recurring payments, and how to create conditional payment notification emails.

Conditional Logic for Payments

As an example, we’ll create a form to let users choose to submit either a one-time or recurring donation.

To get started, we’ll create a simple donation form. This will need to include either a Dropdown or Multiple Choice field to let users choose whether they’d like to submit a one-time donation or set up a recurring donation.

Creating a conditional Dropdown Items field

Next, access the Stripe settings in the form builder under Payments » Stripe. This is where we’ll set up the conditional logic for our payment options.

stripe-settings

Scroll to the bottom of the settings (under the Recurring Payments section) and toggle on the option labeled Enable Conditional Logic.

Note: If needed, review our tutorial on enabling recurring payments before proceeding.

Enabling conditional logic for Stripe subscription payments

This will display additional fields for you to create your conditional rule. For our example, we’ll set the dropdowns to make a rule that states, Process payment as recurring if How often would you like to donate? is Monthly.

Creating a conditional logic rule for Stripe recurring payments

Note: If you have multiple recurring payment plans, you’ll need to repeat this process for all the plans you’ve created.

Don’t forget to save your form after setting up your conditional logic rule.

Conditional Notification Emails for Completed Payments

By default, WPForms sends out all notification emails as soon as a user submits your form. However, in some cases, you may want to wait to send a notification email until the user’s payment has been successfully processed in Stripe.

To delay notification emails until payment has been successfully completed, go to Settings » Notifications in the form builder. For the notification email that you want to delay, check the box at the bottom of the settings labeled Enable for Stripe completed payments.

Enabling a conditional notification for completed Stripe payments

Note: Need help setting up your notification emails? See our guides to notifications settings and conditional notifications for more information.

That’s it! Now you know how to set up conditional payments with WPForms Stripe Pro addon.

Next, would you like to allow users to choose how they complete a payment in your form? Be sure to check out our tutorial on allowing visitors to choose a payment method for more details.