You’ve created your WooCommerce store, uploaded all your products and are ready to accept payments via PayPal. But how can you know for certain if PayPal will work as expected with your store?
Most people will make a small purchase with a friend’s PayPal account as a live test. But that costs real money and is annoying if you have to test multiple times. This post explains how to test the payment system using the PayPal Sandbox.
The PayPal Sandbox is a place where you can test your shopping cart and other PayPal integrations in a realistic way, except that no money changes hands. This means you can test your PayPal processes in the Sandbox and know they will behave the same on the when you go live.
The PayPal Sandbox environment comprises the following:
- The Sandbox test site (https://www.sandbox.paypal.com/)
- The Sandbox Accounts page (accessed through https://developer.paypal.com)
You should take some time to read the official documentation.
How it all fits together
Here are the steps that this post will show you:
- Login to the PayPal developer website with your existing PayPal account
- Create Sandbox test accounts for the shop owner, and another one for a buyer
- Set the WooCommerce PayPal settings to the shop owner’s API details WooCommerce
- Make test purchases – without spending any real money
Login to the PayPal developer website
The first thing you need to do is to login to the PayPal developer website: http://developer.paypal.com
Use your existing PayPal username and password to login. Once logged in you’ll arrive at the Dashboard. Navigate to Applications → Sandbox accounts (screenshot above).
Create Sandbox test accounts
Now we’ll need to create 2 test accounts – 1 for the merchant (representing your shop’s PayPal account) and 1 for a buyer (representing a customer).
Click the Create Account button to create an account.
You can make up an email address since no emails will ever be sent here. I like to use use
@whatever.com to remind me that it’s a merchant (business) account. It’s also useful to enter a name for the merchant account – this will appear on the make payment screen later.
PayPal’s documentation is pretty poor, so through trial and error and googling I found that passwords must contain symbols, numbers, upper-case characters. Also, I read that it’s best to have a starting balance of less than $1000.00.
Tip: I use
$andb0xPa$$w0rd as the password, and repeat it for all Sandbox test accounts so I don’t need to remember multiple passwords.
Configure WooCommerce PayPal settings
Now go back to your WooCommerce store. Go to your WordPress dashboard → WooCommerce → Settings → Payment Gateways → PayPal. Configure it like the following:
- Select checkbox: Enable PayPal standard
- Use the merchant test account email you created in Step 2 above for the PayPal & Receiver email
- Select checkbox: Enable PayPal sandbox
Save changes to save the settings.
Now the PayPal payment method is in test mode and will only accept test payments. Attempts to make payment with real PayPal accounts will result in payment failure. Keep in mind this only affects your PayPal payment method. If you have other payment gateways active (bank transfer, Authorize.net, etc) they will still accept real payments.
Make a test purchase
Now you can make a test purchase using the buyer test account. Using a different browser, visit your store and make a purchase. After you click the Place Order button, you will be sent to test store on the PayPal Sandbox to make your payment.
You’ll know that it’s the test store because “test store” is visible in the store name and the URL is
www.sandbox.paypal.com. PayPal may also add a Test Site label to the top or bottom of the page.
Login with the buyer test account and confirm the payment. Click the Return to merchant link to complete the order.
Congratulations! You’ve made a test payment with PayPal – without using any real money. Were there problems during the checkout process? Well you can make repeat test payments again and again till you solve the problem.
The Sandbox works almost exactly like the real PayPal site. One of the differences is that it doesn’t send any payment sent / received or error emails. To view those emails, you have to click on the notifications link for the appropriate account in the Sandbox Accounts page.
Remember that the payments are test payments. However, keep in mind that WooCommerce will still record them as orders in the system and will generate and send order confirmations, invoices, etc. Remember to delete these orders once you’re done testing.
And finally once you’re done testing, don’t forget to go to your WooCommerce settings to disable the sandbox and enter your real PayPal account details.