Integrate Stripe Payment Gateway

This guide will show you how to integrate with the Stripe payment gateway/merchant processor for accepting credit card payments on your OptimizePress OptimizeCheckouts forms

Please note: In order to use Stripe in LIVE mode, you will need to ensure your site has a valid and active SSL certificate.  If you need help with this, please contact your hosting company.  Most hosting providers now include a free SSL certificate option if you do not have specific requirements.

You’ll also need a Stripe account to complete the integration process.  

Connecting Test & Live Modes

The first step in using Stripe is to connect OptimizeCheckouts to Stripe in test and live modes.  This allows you to effectively test your checkout processes before going live with your products. We recommend testing all products in test mode (to ensure emails and any logins are delivered) before activating the product in live mode.

We recommend connecting Stripe Test mode first (don’t worry you can have both modes connected at the same time).  The process is pretty much the same for Test mode and Live mode…

If you already connected Stripe Test mode, click here to learn how to connect Stripe Live Mode

Connecting Stripe Test Mode

We’ll walk you through connecting Test mode first.  

To connect Stripe in test mode, click on ” Checkouts > Settings > Payment Gateways” and you’ll see Stripe there.

Just click the green ” Connect Stripe” button. 

Now you’ll see the options to connect either in Test mode, or Live mode. 
Click the blue ” Connect” button to the right of “Stripe Test Mode

Now click the ” Connect Stripe in Test Mode” button

Once you login to Stripe on the next screen, you’ll see the option to choose the account you want to connect to.

If you just have one account then it will automatically select that.

Once you connect, you’ll be brought back to your OptimizePress Checkouts screen.

You’ll now need to ensure that your Checkouts Test Webhook is added inside your Stripe account.

Setting Stripe Test Webhooks

To use OptimizePress with Stripe, you must add webhooks inside your Stripe account for TEST and LIVE mode connections. We’ll show you how to setup the test webhooks first:

Webhooks will enable secure communication between OptimizeCheckouts and Stripe.  Follow the steps below to connect Stripe and OptimizeCheckouts.  

Once you connected Stripe in Test Mode (above) you’ll go back to ” Checkouts > Settings > Payment Gateways” and click on Stripe and go back to the connection screen seen here, and click “Edit” to the right of “Stripe Test Mode

Now you’ll need to grab the TEST Endpoint URL: 

Now you’ll need to go login to Stripe, and make sure you click ” Test Mode

Then click on ” Developers

Now click on ” Webhooks” on the left side of the screen: 

Now click on ” Add Endpoint

Paste in the URL that you grabbed a few steps ago, and if you want to add a description you may do so: 

Before you click “add endpoint” button, you’ll first need to click ” Select Events” 

The following events are needed (it’s okay to have others if you need them but these are the minimum required).

  • charge.refunded
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_failed
  • invoice.payment_succeeded
  • subscription_schedule.canceled
  • subscription_schedule.completed
  • customer.source.updated
  • customer.source.expiring
  • customer.source.deleted
  • customer.source.created
  • payment_method.updated
  • payment_method.detached
  • payment_method.automatically_updated
  • (or) payment_method.card_automatically_updated (note that this event can be different depending on when your account was established)
  • payment_method.attached
  • customer.tax_id.created
  • customer.tax_id.deleted
  • customer.tax_id.updated

NOTE: Do NOT click the “Listen to events on Connected accounts” above the “select events” as that is not needed and may result in an error message when trying to save the endpoint

You can search for events by typing the name of the event (do not check the box to “select all” as that is going to give errors since Stripe changed a lot of things).

When you start typing you can see the events and just check the boxes for them

Once you add the events, click ” Add events” button

Then make sure to scroll back through and ensure you didn’t miss any events. Once you ensure they are all selected, then click the ” Add endpoint”  button (if you missed any then just click “Change events” link above the Add Endpoints button.

On the next screen, you’ll need to grab the Signing Secret key – click ” Reveal

Now copy the Signing Secret

Now go back to the stripe settings in OptimizeCheckouts and paste the Signing Secret into the “Test Signing Secret” field (you should already be on that page after you connected the Stripe account in test mode earlier in this guide). If you are not on that page, just go to ” checkouts > settings > payment gateways” and click on stripe, and edit the test mode.

After you enter the Test Signing Secret, click on ” Save

Now you should see the “Test Mode Connected” with a green checkmark icon – this indicates that you are connected to Stripe Test Mode and have successfully connected the Test webhook signing secret. 

See our Making Test Purchases documentation when you’re ready.

Connecting Stripe Live Mode

Connecting Stripe in live mode follows the same steps as the Test Mode, with the only difference being that you would setup the webhook in live mode instead of test.

To connect Stripe in Live Mode, navigate on your site to ” Checkouts > Settings > Payment gateways” and you’ll see Stripe there

As you should already have the Test mode enabled, click on ” Edit Stripe” when you move your mouse pointer over the Stripe logo

Click the blue ” Connect” button

Then click the ” Connect Stripe in Live Mode” Button

On the next screen you’ll be taken to Stripe.com to connect your Stripe account. You will need to login to Stripe and then select the account you want to integrate with (if you have more than 1 account). If you have one account for Stripe then it will automatically be selected for you. Click the blue ” Connect” button on that screen.

You’ll now be taken back to your OptimizePress dashboard after a quick minute or so. The next step will be to setup the Live Webhook.

Setup Stripe Live Webhook

Once you connect your Stripe account in Live Mode, you’ll be brought back to your stripe settings in Checkouts. 
Click ” Edit” to the right of “Stripe Live Mode

Copy your webhook URL

Open a new browser tab and go login to your stripe.com account and click on ” Developers” in the top right

Then, on the left please click on ” Webhooks

Click on ” Add an endpoint” – if you already have webhooks setup for other integrations, this screen will look different, but just click on “add endpoint” above the list of existing webhooks if you have any. 

Paste in your Live Webhook URL from Checkouts into the ” Endpoint URL” 

Before you click “Add Endpoint” please click on ” Select events” as we need to add all the events

These are the events that are needed (these are the minimum but you can have more).
  • charge.refunded
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_failed
  • invoice.payment_succeeded
  • subscription_schedule.canceled
  • subscription_schedule.completed
  • customer.source.updated
  • customer.source.expiring
  • customer.source.deleted
  • customer.source.created
  • payment_method.updated
  • payment_method.detached
  • payment_method.automatically_updated
  • (or) payment_method.card_automatically_updated (note that this event can be different depending on when your account was established)
  • payment_method.attached
  • customer.tax_id.created
  • customer.tax_id.deleted
  • customer.tax_id.updated

NOTE: Do NOT click the “Listen to events on Connected accounts” above the “select events” as that is not needed and may result in an error message when trying to save the endpoint

You can search for events by typing the name of the event.

When you start typing you can see the events and just check the boxes for them

Once you add the events, click ” Add Events” button

Before you click the blue “Add endpoints” button at the bottom, be sure you go through and ensure that all the events are selected that are in the list above

After you click the “Add Endpoint” button and the next screen loads, you’ll now need to get the Signing Secret. Click the ” Reveal” link below “Signing Secret” to reveal the secret code (queue the Mission Impossible movie theme…)

Now just copy the Signing Secret and go back to your Stripe Live Settings in Checkouts (you didn’t close that tab did you?). If you closed it, just go to ” Checkouts > Settings > Payment Gateways” and click on Stripe and then “edit” next to Stripe Live Mode.

Paste in the Signing Secret here and click the blue ” Save” button

Once it saves, just refresh your screen and you should see next to “Stripe Live Mode” the ” Live Mode Connected” text with the green checkmark. This means that you have successfully connected Stripe in Live Mode (Confetti now falls from the sky…)

Set Your Product to Live

Now that you connected Stripe Live Mode, don’t forget to set your products to live.

Go to ” Checkouts > Products” and click “edit” next to the product you want to set live
Go to ” Payment Gateways” and set the payment mode to “Live” and click the blue “Save” button

On the products screen you should now see your product live. Make sure to change all your products to live if there are multiple products in your funnel. This would include any bump offer, as well as your upsell and downsell products. 

You can also use a live card and go through the checkout to ensure that everything works and that you didn’t forget to set a product to “live” (you can lower the price if you need to and then change it back). 

Frequently Asked Questions

Why can’t I send the Company Name field to Stripe?
Stripe does not have a Company Name field that is able to be passed through, however any fields that do not carry through to Stripe will be available to you on the Orders or Subscriptions admin pages within the Checkouts menu in WordPress.

Can I use other Stripe integrations such as iDeal or others?
At this time we only support Apple & Google Pay as well as card payments through Stripe. While there are many other payment methods available in Stripe, not all of them are compatible with the features set in the Checkouts plugin, and as such, not all of them can be added. We may look into adding more supported payment methods from Stripe in the future, however we are unable to provide a timescale for these at the moment. 

How can my customers cancel their subscriptions?
Currently, until we build a customer portal within the checkouts plugin, your customers/members will have to contact you about the cancellation so you may login to Stripe and manually cancel the transaction. Hopefully we’ll have a customer portal built soon so you can allow subscribers to update their card details, change the card they are being billed to, and cancel subscriptions if you want to allow that. 

If you have any questions about using Stripe please reach out to our friendly support team and they’ll be happy to help further.

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
Contact Support