How to Use PayPal Sandbox

You can use the PayPal Sandbox to test your website shopping cart.
Image Credit: Hemera Technologies/AbleStock.com/Getty Images

To ensure a satisfactory experience for your customers, your online store must be running smoothly before it launches. The PayPal Sandbox is an environment in which you can test PayPal transactions made through your site. The Sandbox is useful for testing apps that involve PayPal transactions, website PayPal buttons and PayPal IPN listeners. To use the Sandbox, you must log in to the site with your PayPal information and create the appropriate test accounts.

Advertisement

Creating Test Accounts

Video of the Day

Step 1

Navigate to the PayPal Developer site in your Internet browser (see link in Resources).

Video of the Day

Step 2

Log in using your PayPal username and password.

Advertisement

Step 3

Select the "Applications" tab.

Step 4

Click "Sandbox accounts."

Step 5

Click "Create Account."

Advertisement

Step 6

Select "Personal" as the account type. A Personal account acts as a buyer for your Sandbox transactions. A Business account is the seller. PayPal automatically creates a Business Account the first time you sign in as a developer.

Step 7

Enter an email address for your Personal account. This does not need to be an existing email account, as any emails sent to it will only travel within the Sandbox environment.

Advertisement

Step 8

Enter a password for the Personal account. You will use this to log in to the Sandbox account for this buyer.

Step 9

Add an initial balance to the account. This must be an integer up to 5,000. This balance is not real money. It is virtual money you can use within the PayPal Sandbox.

Advertisement

Advertisement

Step 10

Select a payment card for the account. Select between a Discover card and a PayPal card. These are payment cards linked with a PayPal account. Here, these are virtual cards for use only within the PayPal Sandbox.

Step 11

Select a credit card type for the account. Again, these are virtual credit cards. The account will automatically be assigned fictional credit card account information when you create it.

Advertisement

Step 12

Click "Create Account."

Creating a Test Button

Step 1

Navigate to the PayPal Sandbox site in your Internet browser (see link in Resources).

Advertisement

Step 2

Log in using your Sandbox Business account.

Step 3

Select "My Saved Buttons" from the Tools region of your account.

Step 4

Click "Create new button" in the Related Items section.

Advertisement

Advertisement

Step 5

Enter information for your test button. Each PayPal button requires information such as the item name, the price and the shipping cost, if applicable.

Step 6

Click "Create Button."

Advertisement

Step 7

Copy the HTML for your button.

Step 8

Paste the HTML in the code of your website. This will create a Sandbox version of your website store. When you access this button through your website, use your Personal Sandbox account as the seller.

Advertisement

Configuring Your App

Step 1

Navigate to the PayPal Developer site in your Internet browser (see link in Resources).

Step 2

Log in using your PayPal information.

Step 3

Click the "Applications" tab.

Step 4

Click "REST API Credentials" in the Applications section.

Advertisement

Step 5

Copy and paste the test credentials into your app code. Any calls your app makes must be made to "api.sandbox.paypal.com" instead of "www.paypal.com" (without the quotations). This will allow your app to use the Sandbox environment for testing. Furthermore, the client ID and secret will allow your app to receive a Sandbox Oauth token for authentication during testing.

Testing Your IPN Listener

Step 1

Navigate to the PayPal Developer site in your Internet browser (see link in Resources).

Step 2

Log in using your PayPal information.

Step 3

Click the "Applications" tab.

Step 4

Click "IPN Simulator" in the Tools section.

Step 5

Enter the URL for your IPN listener script. The script code of your IPN listener should be set to make calls to "https://www.sandbox.paypal.com/" instead of "https://www.paypal.com/" (without the quotations).

Step 6

Select the transaction type. The transaction type refers to the method by which a customer will interact with PayPal through your site. For example, if you are testing your IPN script for a PayPal button transaction, use the "Web Accept" type.

Step 7

Click "Send IPN." If the IPN script is working successfully, you will see a confirmation message that reads "IPN sent successfully." Otherwise, you will see an error message describing the nature of the error.

Tip

Any notifications sent within the Sandbox system are visible in the Dashboard section of your Developer account. This is useful for viewing the outcome of a test transaction.

Advertisement

Advertisement