Gravity Forms and Stripe allows you to quickly and easily implement credit card payments with WordPress! With the Stripe Add-On you can capture one time credit card payments or setup recurring payment subscriptions.
If you are familiar with our other Gravity Forms Add-Ons, or even if you’re not, you’ll be right at home getting started with the Stripe Add-On!
* Gravity Forms v1.8.8+
* WordPress v3.8+
* SSL Certificate Installed and Configured
Because of the secure nature of capturing credit card information you will be required to purchase and install an SSL certificate on your web site if you have not already done so. You will also need to configure your WordPress site to work properly with SSL.
Contact your web host if you need assistance purchasing and configuring an SSL certificate.
If you need assistance configuring your WordPress site to work with SSL we recommend the WordPress HTTPS (SSL) Plugin which you can find here:
##Install The Stripe Add-On
The easiest way to install the Stripe Add-On is from within your WordPress site itself. If you have properly configured your Gravity Forms license key on the Settings page of Gravity Forms you should have access to the built in Add-On manager.
- Login to your WordPress admin dashboard.
- Go to Add-Ons under the Forms navigation.
- Install and Activate the Stripe Add-On.
- Get Started!
If you would like to install the Stripe Add-On manually, or have trouble accessing the Add-On manager, you can follow the instructions below:
- Download the add-on plugin from the Add-Ons download page.
- Login to your WordPress admin dashboard.
- Go to Add New under the Plugins navigation.
- Choose Upload from the Install Plugins sub-navigation.
- Upload, Install and Activate the Stripe Add-On.
- Get Started!
##Setup Your Form
After installing the Stripe Add-On, the first thing you will need to do is configure your form to work with it. This is done by using the Pricing Fields to configure the purchase selections and the Credit Card field to allow users to enter their credit card information on the form.
- Go to New Form under the Forms navigation or choose an existing form from Edit Forms in your WordPress admin dashboard.
- Add Fields for capturing standard payment information such as Name, Email, Address, etc.
- Add Pricing Fields to your form and configure them to suit your needs.
- Add a Credit Card Field from the Pricing Fields toolbox to your form.
- Save your form.
- Setup Stripe.
Now that you have your form created the way you want it, it’s time to setup the Stripe Add-On and connect it to your Stripe account. This is done via Stripe’s API and the setup requires you enter your Stripe API account credentials on the Stripe Add-On Settings page.
- Go to Settings under the Forms navigation in your WordPress admin dashboard.
- Select Stripe from the Settings sub-navigation.
- Select the API to use for Stripe integration, Live or Test. Live is for real transactions, Test is for testing the integration and submitting test forms.
- Enter the Test Secret Key for your Stripe account.
- Enter the Test Publishable Key for your Stripe account.
- Enter the Live Secret Key for your Stripe account.
- Enter the Live Publishable Key for your Stripe account.
- Confirm that you have enabled Webhooks in Stripe by following the instructions provided in the Settings.
- Setup Stripe Feeds.
How do you find your Test and Live API Keys? Login to your Stripe account at http://www.stripe.com and go to your Account Settings. Select API Keys from within the Stripe Account Settings and the Live and Test API Keys for your account will be displayed.
##Setup Stripe Feeds
Now that you have configured the Stripe Add-On to work with your Stripe account, and you have a form configured and ready to interact with Stripe, it’s time to bring it all together by configuring the form to integrate with Stripe. Just like all of Gravity Forms Add-Ons, this integration is done by creating a feed.
- Go to the Stripe settings page located under the Forms Settings for the Form you’d like to integrate with Stripe.
- Select Add New to add a new Stripe Feed.
- Enter a Name for this Stripe Feed. This is to distinguish between multiple Stripe Feeds in situations where multiple Stripe Feeds may be necessary.
- Select the Stripe Transaction Type. You can choose from Products and Services which is a single one time payment, or Subscription for recurring payment subscriptions.
- If you have chosen Products and Services as your Transaction type you will then select what determines the payment amount. You can choose a specific Product Field to determine the payment amount, or the overall Form Total.
- If you have chosen a Subscription as your Transaction Type you will be given options for the Recurring Amount, Billing Cycle, Setup Fee and if a Trial is enabled or not. You will also be given the option to map Email and Description under Customer Information.
- If you would like the Stripe integration to occur conditionally, enable Conditional Logic. This functions just like Conditional Logic on fields by only triggering the execution of this Stripe Feed if the condition is met. Conditional Logic also allows you to configure multiple Stripe Feeds for a single form and trigger the correct one based on Conditional Logic.
- Save the Stripe Feed.
##About The Credit Card Field
The Stripe Add-On enables the Credit Card Field in Gravity Forms. This field appears in the Pricing Fields toolbox of the Form Editor. The Credit Card Field makes it easy to capture credit card information. It includes integrated card type detection so the user does not have to pick which type of card he is using and it also has built in validation to validate that the card format is correct.
This field does not actually store the Credit Card data. It is available as part of the initial form submission strictly as part of integration with the Stripe Add-On and other payment gateway add-ons. This data will not be stored as part of the form entry and is not retained by your site, server, or database.
If you Preview or view your form on a page that is not secure, it will be obvious, both to you and your users if you do not properly secure the page. If the page is unsecured the Credit Card Field will be highlighted with a red warning. This warning will not be displayed if the page displaying the form is loaded via https with a valid SSL certificate.
##Stripe Subscription Cancellations
When setting up a Stripe Subscription, please keep in mind that the only way to currently cancel a subscription is via the WordPress Dashboard or the Stripe admin. You cancel an existing subscription by viewing the entry associated with the subscription and choosing the cancel option for the Stripe subscription.
Stripe Add-on Hooks
The Stripe Add-on provides hooks that can be used to modify the default functionality or extend it. For more information, review the Stripe Add-on Hooks.
Add-on Framework Hooks
Because the Stripe Add-on is built using the Add-on Framework it also inherits any hooks available in the framework methods it uses such as:
- gform_SLUG_field_value for changing a field value before it is passed to Stripe.