User's Manual
Table Of Contents
- Preface
- Introduction
- PayPal Payments Overview
- Getting Started
- PayPal Account Optional
- Creating Buy Now and Donation Buttons
- Creating Shopping Cart Buttons
- Adding PayPal to Your Third- party Shopping Cart
- Custom Payment Pages
- Calculating Shipping, Handling, and Tax
- Creating Customer Contact Telephone
- Auto Return
- Backend Integration - Payment Notifications
- Using Multiple Currencies
- Language Encoding for Your Data
- Testing
- Processing eChecks
- Security
- HTML Samples
- IPN and PDT Variables
- About These Tables of Variables
- test_ipn Variable in Sandbox
- IPN Variables in All Posts
- Buyer Information
- Basic Information
- Advanced and Custom Information
- Shopping Cart Information
- Currency and Currency Exchange
- Auctions
- Mass Payment
- Subscriptions Variables
- Dispute Notification Variables
- PDT-Specific Variables
- Country Codes
Merchant User Manual and Integration Guide May, 2005 101
Backend Integration - Payment Notifications
Payment Data Transfer
12
PDT and PayPal Account Optional Feature
The PayPal Account Optional no longer requires your customers who are new to PayPal to
create a PayPal account to complete a purchase—they will go through an alternate checkout,
and will have the option to sign up afterward. Customers who already have PayPal accounts
will continue to enjoy the privileges of those accounts, such as payment history and integration
with eBay Auctions, and their checkout experience will remain the same.
This PayPal Account Optional feature is available for Buy Now, Donations, and Shopping
Cart buttons, but not for Subscription buttons.
The PayPal Account Optional feature is enabled by default. If the merchant has turned on
Payment Data Transfer and has not disabled PayPal Account Optional, a new user will not be
automatically directed back to the merchant website, but will be given the option to return.
When the buyer clicks Continue, the transaction ID associated with the transaction is sent.
The merchant returns the transaction ID, along with their identity token, and PayPal then sends
the merchant payment information that confirms that the payment is complete. The buyer is
directed back to the merchant site where the transaction information is displayed. However, if
the buyer does not click Continue, they will not be directed back the merchant's site and PDT
will not be initiated.
Setting Up Payment Data Transfer
Once you have activated PDT, every time a buyer makes a website payment and is redirected
to your return URL, a transaction token will be passed along as a GET variable to this return
URL. In order to properly use PDT and display transaction details to your customer, you
should fetch the transaction token, variable name tx, and retrieve transaction details from
PayPal by constructing an HTTP POST to PayPal.
Your POST should be sent to https://www.paypal.com/cgi-bin/webscr. You must post the
transaction token using the variable tx and the value of the transaction token previously
received (e.g. tx=transaction_token), and the special identity token using the variable
at and the value of your PDT identity token (e.g. at=identity_token). You will also
need to append a variable named cmd with the value _notify-synch, for example
cmd=_notify-synch, to the POST string.
PayPal will respond to the post with a single word, SUCCESS or FAIL, on one line in the
body of the response. When you receive a SUCCESS response, the rest of the body of the
response will be the transaction details, one per line, in the format key=value where key and
value will both be URL encoded strings. This response data needs to be parsed appropriately
and then Web decoded.
Example successful response:
SUCCESS
first_name=Jane+Doe
last_name=Smith
payment_status=Completed
payer_email=janedoesmith%40hotmail.com
payment_gross=3.99
mc_currency=USD