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.

Login to the PayPal developer website

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.

Click for larger image

You can make up an email address since no emails will ever be sent here. I like to use use merchant@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

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.

Click for larger image

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.

Final notes

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.

Related

About David

David has over 10 years of experience with web geekery and WordPress. That experience spans every­thing from cre­at­ing custom themes to opti­miz­ing WordPress sites for thou­sands of page views in a day. Follow David on Twitter at @blogjunkie and circle David on Google+.

Comments

Nice article. You’re right about the documentation on Paypal – it’s diabolical.

Anyway, wonder if you could help. I followed everything you’ve done. My purchases go through ok, Sandbox Paypal notifications are there, the woocommerce order is fine, but no emails are sent to the test customer which is a real email address. Have tried multiple emails but they’re not sending.

The emails send for my other two payment methods – BACS and cheque. Is there something I should look for in woocommerce or Paypal sandbox to make sure sales emails are sent?

With Sandbox transactions, all transactions including emails are simulated including the emails sent from PayPal. If you’re looking for the PayPal transaction emails they’ll be on the notifications page within the PayPal developer portal

Thanks for the reply David. I can’t see why the other payment methods would trigger emails to be sent to the customer but paypal in sandbox mode does not. The order is at processing mode which according to Woocommerce documentation is ‘Processing – Payment received and stock has been reduced- the order is awaiting fulfilment’

I get the IPN notification from paypal notification so there is nothing wrong with the woocommerce setup. I shouldn’t need to add a plugin to send emails as they send perfectly well for the other payment methods. I’ll give it a crack though and see what happens….

David, this is amazing doc thank you very mach really… However my problem is same with Dave despite I already use the wp-smtp plug-in. All payment methods are fine to send woo-commerce email but the paypal mmmm no way. I’ve made a real payment with a real credit card but, nope. Do you have any idea to figure out how to get rid of that 🙂

This works great on the regular paypal setting, but what about the Advanced extension? I enabled the sandbox option, but this plugin doesn’t use a simple email account. Do you know how I can get this working?

Probable it’s too late but may be useful for others whose experiencing the same. This is due to Currency Unit allowed with your WooCommerce and PayPal sandbox. Changing to USD both of them is a solution

Hi Dylan, yes there is a setting somewhere which I used to change the name of my test store to “Max Merchant’s Test Store” in the example above. The setting is buried somewhere in the Sandbox settings at developer.paypal.com – good hunting!

Hey David.
I had sandbox enabled for a while when testing everything. Unwittingly, I kept it enabled and a couple of orders actually came through. They seemingly were processed by paypal and everything (however the funds are not showing in my paypal account) and I have just realized that the sandbox option has been checked this whole time 🙁

Do you think the payments were ever really processed and they’re sitting out there somewhere in the ether or have I just stupidly lost money?

Yikes! Unfortunately you will not be receiving any payments for those transactions. You should contact your customers to say that there was a problem processing their payments and you need them to re-purchase / send their payment again..

I am still trying to get this resolved with Woo, but in the meantime maybe you have some advise. I have tried a few different combinations of username/password of the sandbox account in the Woo PayPal Advanced plugin but no luck. Take a look at these two screenshots and let me know what should go where…

After following your instructions on setting up the sandbox test store I tried testing it as a customer. Everything on the WooCommerce side seemed to work perfectly, but each time it’s rejected my ACTUAL PayPal email and password. I’m probably missing something, but I can’t for the life of me figure out what. I’ve tried it using 4 different browsers on 2 computers with no luck. Any help will be greatly appreciated.

Hi Doug, I’m not sure that you can / should use live (actual) PayPal info in sandbox mode. The sandbox should be for testing only. If you want to test with a live account you should configure the site with live merchant account details.

I was pretty sure that was wrong, but I had been trying with the email and password set up in the PayPal Sandbox and have only ever gotten the prompt: “You are logging into the account of the seller for this purchase. Please change your login information and try again.” Change to what login information? All I’ve entered, as per your instructions, was the email I made up: [email protected] and the suggested password. And those won’t work as stated above. Thanks.

hey, i just worked with this system… i’m able to pay as a buyer but there is no payment in the merchant’s paypal account on sandbox.
“payment to” is there in the buyer’s account but the payment is unclaimed plus there is no “payment from” in the merchant’s account on sandbox.
please help

David, you sir are a gentleman and a scholar! Instead of burning through hours of trial and error setting up and testing, I can now focus on the things my clients will care about. I’m stoked I found your article. Thanks so much!

My problem seems similar to Kiri’s but I didn’t get a clear answer out of those comments. I had a sandbox account set up and some customers made real credit card payments through it. The payments show up in the sandbox business account but I haven’t asked the customers if their real credit card accounts lost balance. Would they lose balance and also is there a way to refund or transfer that money if they lost credit card balance?

Hi Josh. Yes their payments would show up because the Sandbox simulates all transactions as accurately as possible. This means that your store will also think that the orders are “real” and cause it to reduce stock, send out confirmation emails, etc.

On the buyer side though, they shouldn’t have been charged. Can you please check and report back and I’ll update my article. Thanks

Thanks for the great info. I’m starting a digital download ecommerce site for a single product and I use the woocommerce plugin. Is there a way to avoid my customers having to enter any personal information on my site (e.g., name, address, etc) and complete the entire transaction on paypal? Thanks.

Hi David,
This is a great tutorial, simple to follow..I am having a problem however as I can get no further than the WooCommerce Paypal settings page: it won’t accept the sandbox merchant email account? I have tried with 4 different email accounts (fake) that i have associated with Sandbox accounts. It will only accept my real business email that is linked to my real Paypal account. ???

Nice, detailed article about testing with PayPal, which everybody needs to be doing prior to launching their website…especially developers of plugins, which unfortunately I find all too often doesn’t happen.

I wound up developing my own PayPal extension for Woo which integrates Express Checkout and Payments Pro and makes the integrate with PayPal a lot more seamless than what comes with Woo by default (and improves greatly upon what Woo sells for EC and Pro.)

Hi there – great post, wish I’d found earlier ! I actually stumbled through and figured it out, but now am stuck on one issue: negative testing. I’d like to force an error situation, and have seen this lengthy explanation on sandbox https://developer.paypal.com/docs/classic/lifecycle/sb_error-conditions/
but am at a loss as to how to implement it in woo commerce. Any ideas/tips?