Hello, is this thing on? Many of us who have, or are in the process of launching, e-commerce sites have wondered about this at one time or another. The most common way of finding out is to make a test purchase of $1 or less, to see if everything works. At about 35 cents a try (in PayPal fees), most people simply consider it a start up cost. But there is an alternative, that costs nothing to use; the PayPal Sandbox.
With the sandbox you can simulate PayPal transactions, as many times as you want, without incurring any processing fees. Not only can you simulate actual purchases, you can test drive your e-commerce site from the purchaser’s point of view. You can even simulate how your site will react to purchasers with varying levels of PayPal funding and verification.
You will first need a PayPal sandbox account. This account is separate from any of your primary or alternate PayPal accounts. To get an account, visit the PayPal Sandbox site and Sign Up for Access to the Sandbox Test Environment. Usually, when selecting an e-mail address for your sandbox account, you would normally not use an e-mail address associated with your site’s domain; for security reasons. However, if you plan to conduct end-to-end testing that involves the sending of e-mail messages to customers, you might want to use a “hard to guess” e-mail address on your site’s domain, for the sandbox account.
Once you have completed the sign up and verification process, you should be able to log into your sandbox account. Once logged in, you are at the sandbox “Home” page. The two sections of the sandbox you will likely use the most are “Test Accounts” and “Test Email.”
Test accounts are simulations of PayPal buyers and sellers. Each test account has access to its own (simulated) PayPal account. To properly test your site, you need to create 1 “Seller” and at least 1 “Buyer” test account. To create test accounts, from the “Home” page of your sandbox account, select whether to “create a preconfigured account” or “create an account manually.” It is recommended that you use preconfigured buyer & seller accounts, and then adjust them as needed.
After your test accounts have been created, you can goto the “Test Accounts” section of the sandbox, select an account, and then click “Enter Sandbox Test Site.” Doing so will permit you to log into the simulated PayPal accounts of each test account; where you can perform most operations associated with real buyer and seller accounts.
Whenever the “real” PayPal system processes transactions, it sends e-mail messages to the parties (buyer & seller accounts) involved. The test accounts you create are assigned randomly suffixed e-mail addresses; with the same domain as your sandbox account. The “Test Email” section of the sandbox will contain all e-mail messages that PayPal would normally try sending to real buyers and sellers.
This section (of the sandbox) however, will not capture any e-mail messages that your site might send to simulated buyers. If you create a “firstname.lastname@example.org” sandbox account, the sandbox will assign any test accounts it creates to the “yahoo.com” domain. Any e-mail the sandbox tries to send to “email@example.com” will be captured and saved in the “Test Email” section of the sandbox. Any messages your site tries sending to that same (simulated Yahoo) e-mail address, will be sent to Yahoo and then bounced back to the (simulated) non-existent seller account (also at Yahoo). Eventually, after enough bounces, the message becomes “lost in the bit bucket.”
To prevent this, and to test the sending of customer e-mails, you might consider creating a “catch all” e-mail account for your site domain. Your sandbox account could be “firstname.lastname@example.org” which causes any test accounts you create to be assigned to the “mysite.com” domain. Using the “catch all” e-mail account, you could then test whether or not your site is properly sending all the messages it should be, to the buyer.
Configuring Your Site
Most e-commerce packages (such as WP eStore) that support PayPal, also support use of the PayPal Sandbox. To setup your site, for sandbox testing, you only need to do 2 things; enable sandbox testing and specify your sandbox generated, seller test account, e-mail address. Look for a setting (usually a check box) in your e-commerce software that says something like “enable sandbox mode.” In the place where you specify your regular PayPal e-mail address, insert your seller test account a-mail address. Save the settings Now we are ready to play!
After configuring your software, if you immediately ran off, expecting everything to work… sorry. In order for sandbox transactions to be properly processed, you must be logged into your sandbox account. Here’s what you need to be doing…
Open 2 browser windows, or tabs; using the same browser session. The first window is the “Test Conductor” window, and the second is the “Test Subject” window. In the test conductor window, log into your PayPal Sandbox account. In the test subject window, browse on over to your e-commerce site; and make sure that you are not logged in as the administrator.
In the test subject window, proceed to perform whatever test purchases or transactions you’d like. Use the buyer test account e-mail address for all transactions. Any PayPal generated e-mails will show up in the “Test Email” section of the sandbox; accessible from the test conductor window. If you are using a “catch all” e-mail address (as earlier discussed), you will be able to read any e-mail messages generated by your site, as well.
Caveats And Warnings
- You must be logged into the sandbox, in order for test transactions to go through.
- Anyone trying to make “real purchases” while the site is configured for sandbox testing will be disappointed. They will be presented with the PayPal Sandbox login page, when they try to checkout.
- Sandbox transactions are indistinguishable from real transactions. Any sales, inventory or accounting records kept by your site will “think” that a real sale has occurred. Remember to reset any inventory or sales records.
- Remember to undo the sandbox configuration changes to your site.
- If, while in sandbox mode, you setup any recurring (subscription) payments; remember to cancel them. Otherwise months from now, when you are in non sandbox mode, your site will begin receiving invalid IPN from the sandbox; and your first reaction may be to think someone is hacking you.
About the Author: This post was written by TheAssurer who writes for Tips and Tricks HQ and helps out with plugin development.