Text copied from https://clickwp.com/article/woocommerce-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.
- 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: https://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 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.
Passwords must contain symbols, numbers, upper-case characters. It’s best to have a starting balance of less than $1000.00.
Tip: use $andb0xPa$$w0rd as the password, and repeat it for all Sandbox test accounts so you won’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.
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.
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.