WPForms Documentation

Documentation, Reference Materials and Tutorials for WPForms

How to Install and Use the Stripe Addon with WPForms

Would you like to collect payments directly within your form? With our Stripe addon, you can provide an easy way for users to submit payments without ever leaving your site.

In this article, we’ll show you how to install and set up the Stripe addon with WPForms.

Requirements: You will need a Pro license level or higher to access the Stripe addon.

Connecting Stripe to Your WordPress Site

Note: Stripe requires that your site has SSL (https) enabled on the page where you’re adding a live payment form, as this allows you to securely send credit card data to Stripe.

For information on how to set this up, please see WPBeginner’s guide to adding SSL and HTTPS in WordPress.

Before we get started, be sure to install WPForms on your WordPress site. Then, you can go ahead and install and activate the Stripe addon.

Once the Stripe addon is ready to go, you’ll need to open WPForms » Settings in the left menu of your WordPress site. From there, click on the Payments tab.

If you’d like to adjust the currency, go ahead and select the option you need from the Currency dropdown before proceeding.

Open Payments tab of WPForms settings

When you’re ready, scroll down to the Stripe section. Here, you’ll see several fields for Stripe keys need to be filled out to connect your website and Stripe account.

Stripe key fields in WPForms payment settings

To find these keys, you’ll need to log into your Stripe account. Be sure to do this in a new tab or window, as we’ll be returning to those payment settings soon.

We’ll start by copying the test keys. Stripe’s test keys will be used if you test Stripe payments, which we recommend doing before adding your form to a live page.

After logging in, click API in Stripe’s left menu. Under the section titled API Keys, you should see a notice that reads, “Viewing test API keys, toggle to view live keys”. This means that the keys shown here are the test keys you’ll need to copy.

Test keys in Stripe account

When you return to your WPForms payment settings page to paste in these test keys, be careful to place them in the correct fields. The key names will help with this, as the key that begins with pk_test_ will go in the Test Publishable Key field and the key that begins with sk_test_ will go in the Test Secret Key field.

Copy test keys into WPForms settings

Next, we’ll need to copy the live keys, which will be used to collect actual payments when your form is displayed on your site. To find your live keys in Stripe, you’ll need to toggle the option that currently reads Viewing test data.

Toggle to view live data

Note: In order to view your live keys, you’ll need to activate your Stripe account.

When you switch to the live keys, you’ll see a very similar screen. But you can quickly check that these are the keys you need by again looking to the beginning of each key. The Live Publishable Key will begin with pk_live_, and the Live Secret Key will begin with sk_live_.

Live keys in Stripe account

You’ll need to copy these live keys into your WPForms payment settings, as well. Then once all of the Stripe keys have been added to your payment settings, click Save Settings.

Copy Stripe keys into payment settings and save

Adding Stripe Payments to Your Forms

Now that you’ve connected Stripe to your WordPress site, you can start adding Stripe payments to your forms.

First, you’ll need to create a new form or edit an existing form.

In order for a form to work with Stripe, you’ll need at least two fields in your form:

  • An items field (Single Item, Multiple Items, or Dropdown Items)
  • A Credit Card field

For our example, we’ll create a simple order form that includes Name, Email, Dropdown Items, Total, and a Credit Card field.

Stripe order form example

Note: A Total field is not required for Stripe to work, however it’s often helpful for users to easily see how much they’ll be paying.

Once any fields you’d like have been added to the form builder, you’ll need to go to Payments » Stripe. From the Stripe panel, check the box labeled Enable Stripe payments.

Then you’ll be able to enter a short Payment Description, which will appear on the user’s credit card statement. Last, under Stripe Payment Receipt you can choose an Email field from the form where Stripe can send a receipt.

Enable Stripe payments in WPForms

Our Stripe settings also include the option to Enable conditional logic. For details on how to use this, check out our tutorial on allowing users to choose a payment method for your form.

When you’re ready, be sure to Save your form.

That’s it! Now you’re ready to test your Stripe payments or embed your form on a live page.

Now that you’ve set up an order form, would you like to start boosting sales? Be sure to check out our tutorial on optimizing your order forms to learn how.

Changelog

1.1.1 (2017-08-24)

  • Changed: Remove JS functionality adopted in core plugin

1.1.0 (2017-08-01)

  • Changed: Use settings API for WPForms v1.3.9.

1.0.9 (2017-06-13)

  • Changed: Improved performance when checking for credit card fields in the form builder

1.0.8 (2017-03-30)

  • Changed: Updated Stripe API PHP library
  • Changed: Improved Stripe class instance accessibility

1.0.7 (2017-01-17)

  • Changed: Check for charge object before firing transaction completed hook

1.0.6 (2016-12-08)

  • Added: Support for Dropdown Items payment field
  • Added: New action for completed transactions, wpforms_stripe_process_complete
  • Added: New filter stored credit card information, wpforms_stripe_creditcard_value

1.0.5 (2016-10-07)

  • Fixed: Javascript processing method to avoid conflicts with core duplicate submit prevention feature

1.0.4 (2016-08-25)

  • Added: Expanded support for additional currencies
  • Fixed: Localization issues/bugs

1.0.3 (2016-07-07)

  • Added: Conditional logic for payments
  • Changed: Improved error logging

1.0.2 (2016-06-23)

  • Changed: Prevent plugin from running if WPForms Pro is not activated

1.0.1 (2016-04-01)

  • Fixed: PHP notices with some configurations

1.0.0 (2016-03-28)

  • Initial release.