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.
The following video tutorial shows you how to create a PayPal sandbox test account:
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 “[email protected]” 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 protected]” 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 “[email protected]” 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.
Comments (21 responses)
Ouch Paypal just made it more difficult, now you need to setup the sandbox in a real paypal account, so we need to train our customers to teach them how to setup and use the sandbox…
Since now I used to share the developer credentials, now its not possible anymore.
bad bad bad 🙁
@Stephen, Yes they can do the sandbox testing also. =)
Can I get my client to set up his own sandbox account and the use that to pay a buyer in my sandbox account?
I like to give my clients early access to my developments so that they can play with them. It would be helpful if they could simulate payments too at this stage.
PayPal’s Sandbox was unknown to me, so thanks for the information. I’ve been trying to test the “Thank you” page for a digital download purchase to make sure that the shortcode I put in the page will give the buyer the instant download link. However, since getting a token doesn’t seem available in the sandbox, I’m guessing that the sandbox doesn’t go that far for testing.
I’ve gotten the token and everything set to go in my true PayPal account. But, my only PP account is my ‘sellers’ account, so if I try a real-time test purchase using this account, PayPal stops me when it notices I’m paying from the same account as the seller– I need to use a different account. @#$% :/ Oh well..such is life. Still, is there a way to test the ‘thank you’ page download link shortcode even under the circumstances?
Thanks for all the terrific work.
Very nice article, and I must say, typical of your stuff… I’m getting the hang of this stuff quickly by your articles and plugins.
You just use the sandbox URL to submit the payment data rather than the live PayPal URL. You should be able to look into your button code and change the PayPal URL to the sandbox URL.
What happens if you don’t have WP-shop on your websit eand you just made asimple buy now button. how do yuo make your store to be on “sandbox” mode?
@Andy, PayPal’s sandbox is the only way to do test purchases without doing live transactions. You can always suggest to PayPal to introduce another method of testing that doesn’t use sandbox.
I don’t get it! There must be a simpler way to test buying and selling from pay pal.
Is there a step by step method to show how to do this?
Same problem like above comments and waste my half day on that.
Thanks for the good write-up. I am testing my wordpress site using the wp simple shopping cart against a Paypal sandbox I setup. When I select the checkout button on my site I am redirected to the Paypal payment site but the only option on this page is to either create a Paypal account or login to my paypal accout. I have purge all cookies from my machine, made sure I am logged into my Paypal sandbox account but Paypal will still not let the buy pay with a credit card unless they have a Paypal account. Any ideas on how to simulate paypal optional accounts on the sandbox. – Thanks
i am very impressed about this service and very help me to my next project. In fact i did not know about this service before coming to this post.
This was a really helpful tutorial on how to use the Sandbox, and I’m sure it would be a useful feature for people who do a lot of PayPal testing.
Unfortunately for me, I’m the paranoid type and simply can’t get over the question “What if it works in Sandbox but not in real life?”
Completely unreasonable, I know. But paranoia, I’ve heard, had never been based on reason.
So I think, despite the Sandbox, I’ll continue to use my other email account to test PayPal—at least, for the meantime. But it still was a very good tutorial.
I’ve been using the PayPal sandbox a couple of times when setting up e-commerce sites. It works well, but I think the interface and help could be better… I found it easy to get lost, especially when playing with the IPN stuff.
Sounds interesting and very useful. Paypal is the only payment method which seems quite complex to implement. I actually never implemented it before. Think I’ll give it a go and open a Sandbox account.
Wow i didn’t know paypal had such option, this will really come in handy in the future.
Thanks for the article. I didn’t even know how to use paypal sandbox, but I can start playing around with it now.
Nice article! Yeah it is really important to cancel the test subscriptions otherwise you keep getting the recurring payment notifications and get confused 🙂
Very nice article about the one place that many, who are trying to wrap their heads around e-commerce, fear to tread, yet must.
Great article! I didn’t even know how to create a seller and a buyer account under the PayPal sandbox. I will able to do test transaction very easily now.
Wow! Very nice article, I am not so scared to use PayPal sandbox anymore 🙂