Configuring & Troubleshooting with Stripe
Covered in this article:
Video Setup Instructions
What This Video Covers
- 0:00 - 0:30 - Introduction and adding the new gateway option
- 0:30 - 1:35 - Enabling Test Mode and entering Test Keys
- 1:35 - 2:36 - Entering Webhook for Test Mode and Saving
- 2:36 - 3:40 - Switching to Live Mode and entering Live Keys
- 3:40 - End - Entering Webhook for Live Mode and Conclusion
Basic steps to follow when setting up Stripe as a payment gateway:
- Go to MemberPress Options > Payments Tab.
- Click the plus button and select the gateway "Stripe".
- Name it whatever you want. This is the name that your users will see when they go to select how to pay.
- Go your Stripe dashboard to obtain the necessary keys: test secret key, test publishable key, live secret key, and/or live publishable key.
- In Stripe, navigate to API on the left hand menu.
- Select API.
- Copy and paste the keys to your MemberPress settings.
- Copy your "Stripe Webhook URL" from your MemberPress setup page.
- Navigate back to your API settings in Stripe.
- Select Webhooks.
- Select "+ Add endpoint" and paste your unique Webhook into the settings. Make sure to select the correct Live or Test events, that you are on the latest Webhook version, and that you have it set to send all event types.
- Save all settings.
Detailed List of Gateway Settings
Below you will find explanations for every setting that you can find for your Stripe Gateway as a reference for both during and after you have setup your gateway:
- Name - The name users will see when choosing this gateway option during registration.
- Gateway - This should be set to "Stripe" and will not show up on the frontend.
- ID - ID of your gateway used in database and to be entered if importing subscriptions for this gateway as outlined here.
- Show Payment Label - When checked or unchecked, this will show or hide the Name you entered for this gateway option.
- Show Payment Icon - When checked or unchecked, this will show or hide the Stripe Credit Card symbols for this gateway option.
- Show Payment Description - When checked or unchecked, this will show or hide the description for this gateway option.
- Test/Live Secret Key - This is where you will enter your Stripe Secret Key for either Test or Live Mode. Before entering your Test Secret Key, be sure to check the Test Mode box in your Stripe gateway in MemberPress. Both Keys (though only one will show based on the selected mode) can be found by going to your Stripe Dashboard > clicking API near the bottom left of the page > and make sure that API is selected near the top of the page (though it should default to API). Once in there, you will need to click the box that is labeled, "Reveal test key secret," then be sure to properly copy and paste that into the correct location in MemberPress for your Stripe gateway option.
- Test/Live Publishable Key - This is where you will enter your Stripe Publishable Key for either Test or Live Mode. Before entering your Test Publishable Key, be sure to check the Test Mode box in your Stripe gateway in MemberPress. To find these keys, please see the above item. Be sure to properly copy and paste the key into the correct location in MemberPress for your Stripe gateway option.
- Test Mode - Check this box if you would like to use Stripe in Test Mode for Testing. IMPORTANT NOTE: because of how Stripe works, you will NOT be able to simply check this option and start testing! You will have to follow our instructions in the above video to setup Stripe in Test Mode. You can find this between minute 0:30 and 2:36 in the above video.
- Force SSL - Use this option if your site has the option of being viewed in http and https. This will automatically switch to https when a user is going to pay so that the transaction is secure.
- Send Debug Emails - Only enable this option if you are having issues with your Stripe gateway and know how interpret debug emails or have been told to enable them by our support team. Enabling this option will send out about 5 separate debug emails to your email found in your General WordPress Settings.
- Stripe Webhook URL - The Webhook URL is used to communicate data between your Stripe account and MemberPress. It must be entered correctly for either Test or Live Modes to work correctly. Use the clipboard icon to copy over your Wehbook URL. Then go to your Stripe Dashboard > API > Webhooks. When creating the Webhook, make sure that you select the correct Live or Test events, that you are on the latest Webhook version, and that you have it set to send all event types, then click "Add endpoint".
How to Test with Stripe
First, you will need to set your gateway to test mode. You can review how to do this in the above video between the beginning and minute 2:36. When going through the registration process as a new user would, you will need to present test card credentials. Here you can find the list of approved Stripe Test Card credentials. For additional info on testing in MemberPress, please see this page.
How to Process a Refund
Though you should normally be able to follow our instructions to refund users who signed up via Stripe, you can also follow these detailed instructions provided by Stripe support to cancel directly in Stripe if needed.
Canceling in Stripe
Normally, you will want to cancel subscriptions directly in MemberPress as is outlined here. However, you may need to cancel a subscription directly in your Stripe Dashboard. This would mainly be needed if you deleted the subscription in MemberPress before correctly cancelling it. If this or anything else is the case, you can follow these detailed instructions to cancel directly in your Stripe Dashboard (please click here to see these steps done in a brief video):
- Login to your Stripe Dashboard here.
- In the top search bar, search for the user based on the user's email (best) or username.
- Click on the correct customer based on your search.
- Scroll down to the 'Active subscriptions' section.
- Click on the '...' icon.
- Click 'Cancel subscription'.
- In the popup, select 'Immediately' as the option.
- Click the 'End subscription' button.
- Verify that in the 'Active subscriptions' section it now says, "No active subscriptions".
Editing Stripe's Auto-Cancellation Trigger
After X amount of failed attempts to bill a recurring subscription, Stripe will automatically cancel the subscription. Within your Stripe Dashboard, you can control how many attempts Stripe will make before automatically cancelling the subscription. This is done from within your Stripe Dashboard > Billing > Settings > Retry Rules, as shown here:
You are welcome to set this to be whatever you would like, but just note that if you are using Churn Buster, you should have it set to auto-cancel after last failed attempt (as is set with the "cancel the subscription" option from the dropdown as shown above - the same setting is available for Custom dunning rules as well).
If you have followed exactly the instructions on this page for setting up your gateway, then it should work properly. So, if you are noticing issues with your gateway, it is likely going to be related to one of the items listed below. We have also included what to do if you are seeing these issues.
- Subscriptions and/or Transactions aren't updating correctly - If you are seeing subscriptions connecting to MemberPress with an ID that looks like mp-sub-xxxxxxxxxx and transactions that have ID's that look like mp-txn-xxxxxxxxxx then the issue is related to your Webhook URL configuration. Please be certain that you have correctly entered your Webhook URL (including creating a webhook that is NOT for "Connect applications"). You can review how to do this between minute 1:35 and 2:36 for Test Mode or between minute 3:40 and the end for Live Mode in the above video.
- Users are getting this error upon checkout: Invalid API Key provided: pk_test_***********1234 - This means that you have incorrectly entered your API Key. Make sure that you have entered the correct keys into their corresponding locations in MemberPress.
- You or the user aren't receiving the MemberPress Welcome email, New user sign up email, or other MemberPress emails - These new user MemberPress emails are triggered during the registration process by a completed transaction. If the transaction isn't completing in MemberPress, but is marked as such in Stripe, then this is related to the Webhook URL not being setup correctly. You can review how to do this between minute 1:35 and 2:36 for Test Mode or between minute 3:40 and the end for Live Mode in the above video.
- You received an email from Stripe with this subject or similar: Problem with your Stripe webhook (https://yoursite.com/mepr/notify/df5436-452/whk) - This email could be triggered by one of the following three items: (1) Test mode webhooks are failing because test mode data has been deleted, and the site is Live. To resolve simply delete your test mode webhook from Stripe. (2) TLS/SSL certificate issues. Stripe refuses to send the webhook because it doesn't like the SSL setup on the site. To resolve you will need to contact whoever you purchased your SSL/TLS certifate through to make sure your certificate is up to date with the current standards that Stripe is looking for. (3) 403 error caused by an anti-spam or security plugin. To resolve you will need to find the plugin causing the issue by deactivating any plugin fitting that criteria. If the issue goes away after deactivating the plugin, then you will know that is the plugin that was causing the issue.
- Your users are seeing this error before getting to the payment screen: ERROR Invalid Payment Method. - This likely means that you have enabled the Customize Payment Methods and left this gateway option unchecked. To fix this, simply uncheck the Customize Payment Methods option altogether, or if you need it to disable other gateway options for your membership, be sure to check this gateway option.
Are you still having issues with your Stripe gateway even after reviewing the solutions outlined in the Gateway Issues section above? No problem, just send us a support ticket with a brief description of your issue, and what you have found in your tests so far. Please do not send us a support ticket until after you have followed the instructions in the Gateway Issues section to the best of your ability . . . we will ask you to review those things if your issue resembles any of those listed points. : )