PayPal Sandbox

General Topics > Payment Gateways


 

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.

Contents


Getting Started

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 https://developer.paypal.com/ and click the "Sign Up" button.

The following screen will be displayed:

 

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 “Applications” and "Dashboard”

[up to contents]


Test Accounts

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, click "Applications" from the “Home” page of your sandbox account the select the "Sandbox Accounts" link on the left:

 

You will need to create a Personal (Buyer) & Business (Seller) accounts.

 

After your test accounts have been created, you can login to the Sandbox accounts by selecting an account, 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.

[up to contents]


Test Email

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 “paypaltest@yahoo.com” 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 “sndbox_12345_per@yahoo.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 “secretpaypaltest@mysite.com” 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.

[up to contents]


Configuring Your Site

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 and enable the “Test Mode” mode setting. 

First, in the Payment Setup section, select the PayPal Gateway from the Payment Gateway dropdown:

 

Next, in the Merchant ID field, enter your seller test account e-mail address.

 

Then, enable Test Mode by checking the "Test Mode" checkbox:

 

Save the settings

[up to contents]


Processing a Transaction

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.

[up to contents]


Caveats And Warnings

  1. You must be logged into the sandbox, in order for test transactions to go through.
  2. 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.
  3. 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.
  4. Remember to undo the sandbox configuration changes to your site.
  5. 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.

[up to contents]