WooCommerce is the world's most popular e-commerce platform, and it's only going to get more popular. It's free, it's built on WordPress, and you can customize and extend it with a wide range of plugins, including those provided by WooCommerce and on CodeCanyon.
But without making it easy for shoppers to pay you, you won't sell a thing.
In this tutorial, I'll show you how to configure WooCommerce with two of the most popular payment gateways out there: PayPal and Square.
What You'll Need
- A site with an installation of WooCommerce, preferably a development site. It can't be on a local machine, though, or the payment gateways won't be able to interact with it.
- An account with the payment gateway of your choice. If you don't already have one, I'll walk you through these in this tutorial.
- Some products already set up in your WooCommerce store, that you can use to test the checkout process.
Which Gateway to Choose?
The first question (unless you already have an account with one of the payment gateways) is which of them you're going to use. Here's a comparison of the big two, PayPal and Square.
A PayPal business account lets you:
- operate under your company or business name
- accept debit card, credit card, and bank account payments as well as payments from PayPal account holders
- take payments for subscriptions with recurring payments
- give up to 200 employees limited access to your account
- use PayPal checkout to let people pay without leaving your website
- use the sandbox option to test payments before making them live
- take payments in 25 currencies from over 200 countries
PayPal is probably the most familiar platform to most people. It's easy to set up, and you probably already have an account. It's designed for online commerce. And it's the only gateway that lets you add subscriptions.
Square is mostly aimed at physical retailers, with various devices designed to take payments. But it also works for online transactions and has benefits if you run a bricks-and-mortar store as well as an e-commerce site. Here are some features:
- sync online and offline sales and stock control if you have a physical store
- add products to WooCommerce and they'll be added to Square for offline payments
- take credit and debit card payments
- use the Square dashboard to see sales analytics
- allow multiple employees limited access to your dashboard
- only available to businesses based in the U.S., Canada, Australia, Japan, or the UK (but you can take payments from customers worldwide)
If you have a physical store as well as a WooCommerce site, then Square will make your life much easier with inventory syncing and sales tracking. But if you don't plan to open a physical store, then PayPal has more features and is more familiar to customers.
Now let's move on to configuring each of the gateways.
Before You Start
WooCommerce comes with PayPal already integrated; you don't need to install anything. But if you want to add extra integrations such as PayPal checkout, you'll find them on the WooCommerce site. You'll also find more integrations on CodeCanyon.
What you will need is an SSL certificate. This means your site will have https:// instead of https:// before the domain name, and is essential for security. WooCommerce with PayPal requires an SSL certificate, so if you don't have one, follow along with this tutorial on how to set one up for free with Let's Encrypt.
And if you don't already have one, you'll need a PayPal account. Set one up on the PayPal website, following their instructions as you go along.
Configuring PayPal Settings
To start configuring PayPal on your site, go to WooCommerce > Settings, and select the Payments tab:
To activate PayPal, click the Enabled slider, then the Set up button.
Work through each of the settings in turn, adding or customising as you wish. Note that if you uncheck the Enable PayPal Standard option, you'll need to have a business account with PayPal Checkout configured. This makes checkout quicker as customers don't have to leave your site and go to the PayPal site.
While you're getting PayPal set up, check the Enable PayPal sandbox option. This lets you test transactions without actually sending any money. Logging is also useful while you're setting things up. Once your store is working as it should, uncheck both.
So that your site can interact with PayPal, you'll need to set up Instant Payment Notification, or IPN.
Go to your PayPal account and click on the settings icon at the top right. On the settings screen, select My selling preferences on the left.
Scroll down to Instant payment notifications and click the link.
You'll be presented with the IPN settings screen, where you input the URL where IPN will link to your site. The URL will be the following, replacing
example.com with your own URL:
Now click the Save Changes button and you're good to go. Test your payments out and once you're happy with the result, disable the sandbox option.
If you choose to use Square instead of PayPal, you'll need to install the Square for WooCommerce plugin.
Once you've done that, you'll be prompted on the plugins page to link your Square account to your website. You can either click the link in the plugins screen or go to WooCommerce > Settings > Integrations.
Click the Connect with Square button to be taken to Square. You'll be asked for a verification code from your authenticator app, which you'll have set up when you got yourself a Square account.
Next, you'll be prompted to authorize WooCommerce to read data from Square:
Scroll down and click the Allow button. WooCommerce will present you with a screen confirming the site you just hooked up and a redirection button. Click it to go back to your site.
The next step is to set up your business location. This is necessary for Square to work. In the settings screen in WooCommerce, select your business location from the dropdown list. This will be taken from the locations you added when you signed up for Square.
Then scroll down and check or uncheck the boxes for categories, inventory, and more. Finally, click the Save changes button.
Now go back to the Payments tab and make sure you've got Square enabled. If you have both PayPal and Square enabled, this could be confusing, so I recommend just using one. Square will take credit card payments, while PayPal will take payments either by credit card or from a PayPal account.
Select the one you want, deselect the one you don't want, and click the Save changes button.
Now your site will link to Square for payments and inventory management.
WooCommerce Is Now Ready to Take Payments
Now that you've got either PayPal or Square configured to hook up to your WooCommerce store, you can take payments from customers without having to lift a finger. This will make it easier for people to buy from you and help you make more money from your store. Happy selling!
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post