Setup Stripe in WooCommerce: The Ultimate Guide
Step 1: Prepare Your WooCommerce Store
Ensure WooCommerce is Installed and Activated
Before integrating Stripe, confirm that WooCommerce is correctly installed and activated on your WordPress website. Navigate to your WordPress dashboard, then go to “Plugins” > “Installed Plugins.” Look for “WooCommerce” in the list. If it’s not there, go to “Plugins” > “Add New,” search for “WooCommerce,” install it, and then activate it. Ensure you’ve completed the initial WooCommerce setup wizard, including setting up your store’s currency, address, and shipping zones, as these are crucial for payment gateway functionality.
Verify Your Store Meets Stripe’s Requirements
Stripe has specific requirements for secure payment processing. Your website must have an active SSL certificate (HTTPS). You can check this by looking for “https://” in your website’s URL in the browser and a padlock icon. If you don’t have SSL, contact your hosting provider to install one. Additionally, ensure your PHP version is 7.4 or higher, and your WordPress version is up to date (at least 5.6 or newer). You can check your PHP version under “WooCommerce” > “Status” > “Server Environment” in your WordPress dashboard.
Step 2: Install and Configure the WooCommerce Stripe Gateway Plugin
Install the WooCommerce Stripe Gateway Plugin
The easiest and most recommended way to integrate Stripe with WooCommerce is by using the official “WooCommerce Stripe Gateway” plugin. From your WordPress dashboard, go to “Plugins” > “Add New.” In the search bar, type “WooCommerce Stripe Gateway.” The official plugin is usually developed by WooCommerce. Click “Install Now” next to the correct plugin listing. Wait for the installation to complete.
Activate and Access Plugin Settings
Once the installation is finished, the “Install Now” button will change to “Activate.” Click “Activate” to enable the plugin on your site. After activation, you’ll typically be redirected to your installed plugins list. To access the settings, navigate to “WooCommerce” > “Settings” in your WordPress dashboard. Then, click on the “Payments” tab. You should now see “Stripe” (or various Stripe-powered methods like “Credit Card (Stripe)”) listed as an available payment gateway. Click “Manage” next to the “Stripe” option to configure it.
Step 3: Connect Your Stripe Account
Obtain Your Stripe API Keys
To connect your WooCommerce store to Stripe, you’ll need your Stripe API keys. Log in to your Stripe Dashboard (https://dashboard.stripe.com/). In the left-hand navigation, click on “Developers” > “API keys.” You will see two sets of keys: “Publishable key” (starts with ‘pk_live_’) and “Secret key” (starts with ‘sk_live_’). For testing purposes, you can toggle “Viewing test data” to get your test keys (starting with ‘pk_test_’ and ‘sk_test_’). Copy both the Publishable key and the Secret key. Keep these keys secure and do not share them publicly.
Enter API Keys into WooCommerce Stripe Settings
Go back to your WordPress dashboard, navigate to “WooCommerce” > “Settings” > “Payments,” and click “Manage” next to “Stripe.” You will see fields for “Live Publishable Key” and “Live Secret Key.” Paste the respective keys you copied from your Stripe Dashboard into these fields. If you are setting up for testing first, paste the test keys into the “Test Publishable Key” and “Test Secret Key” fields and ensure “Enable Test Mode” is checked. After pasting the keys, scroll down and click “Save changes” to store your credentials.
Step 4: Configure Payment Methods and Test Transactions
Enable Desired Stripe Payment Methods
Within the “WooCommerce” > “Settings” > “Payments” section, you’ll see a list of available payment methods. The WooCommerce Stripe Gateway plugin enables various methods like “Credit Card (Stripe),” “Stripe SEPA Direct Debit,” “Stripe iDEAL,” etc., depending on your Stripe account’s capabilities and country. Toggle the switch next to each Stripe-powered payment method you wish to offer your customers to “On.” For the primary “Credit Card (Stripe)” option, you can also click “Manage” to configure its title and description that customers will see during checkout. Ensure the “Enable Stripe” checkbox is ticked within the main Stripe settings.
Conduct Test Transactions to Verify Setup
Before going live, it’s crucial to perform test transactions.
1. Ensure “Enable Test Mode” is checked in your Stripe settings within WooCommerce.
2. Go to your store’s front end, add a product to your cart, and proceed to checkout.
3. Select “Credit Card (Stripe)” or another Stripe test method.
4. Use Stripe’s test card numbers (e.g., 4242 4242 4242 4242 for Visa, any future expiry date, and any 3-digit CVC).
5. Complete the purchase.
6. Verify the order appears in “WooCommerce” > “Orders” as “Processing” or “Completed.”
7. Log into your Stripe Dashboard and check “Payments” to ensure the test transaction is recorded there.
8. Once verified, uncheck “Enable Test Mode” in WooCommerce Stripe settings, replace test keys with live keys if you haven’t already, and click “Save changes” to go live.
FAQs
What if my Stripe payments are failing after setup?
First, check your Stripe Dashboard’s “Developers” > “Logs” section for any error messages. These logs often provide specific reasons for failures. Common issues include incorrect API keys (ensure you’re using live keys, not test keys, if in live mode), SSL certificate problems, or conflicts with other plugins. Also, verify your webhook is correctly configured in Stripe (Stripe Dashboard > Developers > Webhooks) and points to your WooCommerce store’s webhook URL (usually yoursite.com/?wc-api=wc_stripe).
Do I need an SSL certificate for Stripe?
Yes, an SSL certificate (HTTPS) is absolutely mandatory for processing payments with Stripe. Stripe will not allow transactions on non-HTTPS sites due to security requirements. If your site doesn’t have HTTPS, you’ll face errors during checkout. Contact your hosting provider to install and configure an SSL certificate for your domain.
Can I accept recurring payments with Stripe and WooCommerce?
Yes, you can accept recurring payments (subscriptions) using Stripe in WooCommerce, but it requires an additional plugin: “WooCommerce Subscriptions.” The WooCommerce Subscriptions plugin integrates seamlessly with the WooCommerce Stripe Gateway to handle recurring billing, allowing you to set up subscription products and manage renewals directly within WooCommerce.
How do I refund a Stripe payment in WooCommerce?
To refund a Stripe payment, go to “WooCommerce” > “Orders” in your WordPress dashboard. Click on the specific order you wish to refund. On the order details page, scroll down to the “Order actions” section and click the “Refund” button. Enter the amount to refund (partial or full), add a reason if desired, and then click “Refund via Stripe.” This will process the refund directly through your Stripe account, and the customer will receive their money back.