Table of Contents Previous Next Index

Testing PayPal Website Features

Testing PayPal Website Features
This chapter describes PayPal products features you can test in the Sandbox without PayPal APIs:
l
Website Payments with Buy Now Buttons: Use the Sandbox to test accepting PayPal as a payment mechanism on a website.
l
Shopping Cart Purchases: Use the Sandbox to test the purchase of multiple items in a single transaction using a single payment.
l
Instant Payment Notification (IPN). Use the Sandbox to test IPN for updates and payment notifications.
l
Refunds: Use the Sandbox to test refunding payments from a test buyer.
l
Subscriptions: Use the Sandbox to test subscription buttons.
IMPORTANT:
To execute test transactions on Sandbox you need to complete a purchase as a test buyer with your buyer test account. Typically, you go through your website purchase flow as a buyer. You must ensure that you execute your test on www.sandbox.paypal.com instead of www.paypal.com.
Website Payments with Buy Now Button
You can use the Sandbox to familiarize yourself with the PayPal Buy Now button, with which you can associate PayPal with a specific item you sell on your website.
To create a test Buy Now button:
1.
From the Test Accounts tab, select a business account and click Enter Sandbox Test Site.
2.
Go to the Merchant Services tab.
3.
Select the Buy Now Buttons link under the Key Features heading to get to the Button Factory. You can also search the Help for “Button Factory.”
4.
5.
Copy and paste the code into your web page file wherever you would like the button image to appear. Typically, the button should be located next to the description of the item or service. Your web page does not have to be published to your web server for you to check the button placement; it can be on you own local hard drive.
IMPORTANT:
You must change the form action to redirect to the Sandbox, using the following URL:
https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"
Use the PayPal Help link to answer related questions, such as “How do I make a Buy Now Button compatible with the Shopping Cart feature?” For general information, see https://www.paypal.com/pdn-item. For general information about shopping cart purchases, see https://www.paypal.com/shoppingcart. For general information about subscriptions, see https://www.paypal.com/pdn-recurring.
Encrypted Website Payments
The Sandbox also supports Encrypted Website Payments (EWP), as does the PayPal SDK console.
For information about what EWP is and how to use it, see the Website Payments Standard Integration Guide
For information about using the PayPal SDK console to generate EWP HTML, see the PayPal SDK Guide for any of the supported platforms.
Testing Payments with Buy Now Button
For the purposes of testing the Buy Now button, your web page does not need to be published to your web server. It can reside on your local hard drive. However, you do need to be logged in to the Sandbox.
1.
Log in to https://developer.paypal.com, click the Test Accounts tab, select the desired test account, and click Enter Sandbox Test Site.
2.
3.
Click the Buy Now Button.
4.
5.
Verifying a Test Payment
1.
Log in to https://developer.paypal.com and click the Test Email tab.
Your Sandbox inbox shows payment confirmation email messages for the seller and buyer.
2.
Launch the Sandbox as your test buyer or seller account and navigate to My Account > Overview to see the transaction in your Recent Activity.
Handling Pending Transactions
Transactions typically are credited to your PayPal account instantly after the buyer completes the transaction; however, a buyer might select a payment method that is not completed instantly. In these cases, the transaction goes into a pending state and the transaction is completed after a couple of days. The following sections describe how to set up pending status transactions that can either be completed or canceled.
Creating a Pending Transaction
1.
Log in to https://developer.paypal.com, click the Test Accounts tab, select a buyer (personal or premier) test account, and click Enter Sandbox Test Site.
2.
Log in to your test buyer account and create a transaction, such as one created using a Buy Now button or by passing parameters in the URL as in the following example:
https://www.sandbox.paypal.com/
us/cgi-bin/webscr?cmd=_xclick&business=seller@domain.com
3.
On the Review Purchase Page click on the link Change under funding method.
4.
Select eCheck as the funding method and click Continue.
5.
Click Pay to create the transaction.
To verify the creation of the transaction, see “Verifying a Test Payment”.
Completing or Canceling a Pending Transaction
1.
In the buyer’s transactions log, click the Details link (in the Details column).
2.
Clear Transaction: Click to complete the transaction.
Fail Transaction: Click to cancel the transaction.
Instant Payment Notification (IPN)
You can use the Sandbox to test Instant Payment Notification, such as the PayPal Buy Now button or reversals.
Setting up IPN in the Sandbox
For information about implementing IPN, see the following:
l
l
test_ipn Variable
The Sandbox sets the variable test_ipn with a value of 1 in the HTTP response back to your IPN page. The purpose of this variable is to clearly differentiate between live and Sandbox IPN, so you can write your processing programs to work with either live or Sandbox IPN. If the test_ipn variable is not present in the HTTP response, you are working with Live PayPal.
To enable IPN for a test account:
1.
Log in to https://developer.paypal.com, click the Test Accounts tab, select a test account, and click Enter Sandbox Test Site.
2.
Click the Profile subtab.
3.
Click the Instant Payment Notification Preferences link in the Selling Preferences column.
4.
Click Edit.
5.
6.
Click Save.
7.
Install IPN on your web server. You might want to start with one of PayPal’s source code samples available at https://www.paypal.com/ipn under the Code Samples section. There are source code samples for the several programming languages and development environments. For further information, see the Order Management Integration Guide.
Verifying a Test Refund
To verify a test refund, you must have already made a test payment.
1.
2.
Click the Test Email tab.
Your Sandbox inbox shows refund confirmation email messages for the seller and buyer.
3.
Launch the Sandbox as your test buyer or seller account and navigate to My Account > Overview to see the transaction in your Recent Activity.
Transferring Funds to a Test Account
To transfer funds to a test account:
1.
After logging into https://developer.paypal.com, select a test account and click Enter Sandbox Test Site.
2.
Navigate to My Account > Add Funds.
3.
4.
5.
Navigate to My Account > Overview to see that the transfer transaction is listed.
Clearing or Failing Test eCheck Transactions
When you use eCheck to transfer funds or send payments, the transaction appears as pending until you manually clear or fail it. Manual clearing is only necessary in the Sandbox.
To clear or fail test eCheck transactions:
1.
In the transactions log, click the Details link (in the Details column).
2.
Clear Transaction: Click to complete the transaction.
Fail Transaction: Click to cancel the transaction.
3.
Click Return to Log to see the transfer completed and the money in the Sandbox account.
The My Account > Overview page opens.
4.
Click the View Limits links on the My Account > Overview page to see the spending limits for the current test account.
For an alternative example, see “Completing or Canceling a Pending Transaction”.
Sending Funds to a Seller
To purchase goods or services, a PayPal user must send funds to a seller. In the PayPal Sandbox, you can simulate the actions of a buyer by manually initiating the payment of funds. You must use a Personal test account to represent the buyer.
To send funds from one test account to another:
1.
Log in to https://developer.paypal.com, click the Test Accounts tab, select a test account, and click Enter Sandbox Test Site.
2.
Navigate to the Send Money tab.
3.
4.
5.
Select the currency for the funds in the Currency drop-down list. (Note: Auction is not an option in the drop-down list.)
6.
7.
8.
Enter text in the Note memo box. This text appears in the body of the notification email.
9.
Click Continue. This does not send the money; a confirmation step follows.
10.
On the Check Payment Details page, review the transaction details for correctness. You can click More Funding Options to change the source of fund used for payment.
11.
Click Send Money. This triggers the actual transfer of funds.
12.
Your Test Email tab contains all the email messages that are sent to the test account sending the money and the test account receiving the money. See “Test Email”.
Log in as the seller test account and navigate to the My Account > Overview tab to see the transaction for the recipient’s account.
Billing A Customer
PayPal business users can bill another PayPal user for the purchase of goods or services. In PayPal terminology, the feature to bill a customer is called Request Money. In the PayPal Sandbox, you can manually initiate a request for funds from a test account. One test account is the seller. The other test account is the buyer.
To request funds from a buyer:
1.
Log in to https://developer.paypal.com, click the Test Accounts tab, select a test account for which funds are requested, and click Enter Sandbox Test Site.
2.
Navigate to the Request Money tab.
3.
On the Request Money page, enter the email address (PayPal login name) for the test account being billed in the Recipient’s Email box.
4.
5.
6.
Select the reason for the request for funds (billing) in the Type drop-down list. (Note: Auction is not an option in the drop-down list.)
7.
Enter text in the Subject box. This text is the subject of the email sent to the recipient regarding the sent funds.
8.
Enter text in the Note memo box. This text appears in the body of the notification email.
9.
Click Continue.
10.
On the Request Money Confirm page, click Request Money. This triggers the actual request for funds.
11.
Navigate to the My Account > Overview tab. The request for money should be listed.
12.
Log in as the buyer and navigate to the My Account > Overview tab to see the transaction for the buyer’s test account. The transaction for the request for money appears on the My Account > Overview tab with Pay and Cancel buttons. Click Pay, and in the confirmation window, click Send Money. This completes the transfer of requested funds.
To view the email messages sent to both test accounts, select the Test Email tab. For details about your Sandbox email, see “Test Email”.