Table of Contents Previous Next Index

Payment Data Transfer (PDT)

Payment Data Transfer (PDT)
Merchants who use Website Payments Standard can use Payment Data Transfer (PDT) to display transaction details to buyers who are redirected back to the merchants’ websites after they complete their payments.
Note:
You must enable Auto Return for Website Payments Standard to use Payment Data Transfer. Auto Return applies to PayPal Website Payments Standard, including Buy Now, Donation, Subscriptions, Shopping Cart, and Gift Certficate buttons. For more information about Auto Return, see the PayPal Website Payments Standard Integration Guide.
How PDT Works
Bob is going to purchase a widget from the Widget Warehouse.
Step 1: Bob goes to the Widget Warehouse website, finds the widget he wants, and clicks the Buy Now button.
Step 2: Bob is taken to a PayPal Payment Details page which displays the details of the payment he is about to make.
Step 3: Bob enters his PayPal account information into the PayPal Login fields.
Step 4: Bob is then taken to a confirmation page that displays the details of his selection, information about how his automatic payments will be funded, and his shipping information. He clicks the Pay button to complete the payment.
Step 5: A payment confirmation page appears that informs Bob that his payment has been completed and that he is being redirected back to the Widget Warehouse website.
Step 6: A transaction token is passed to the return URL provided by the Widget Warehouse. The Widget Warehouse fetches the transaction token and retrieves the transaction details from PayPal via an HTTP POST. Included in the HTTP post is the identity token that was given to the Widget Warehouse when PDT was enabled.
For more information about the PDT identity token, see “Getting and Using the Identity Token”. For more information about the HTTP POST, see “PDT Notification Synch”.
Step 7: The Widget Warehouse's Thank You page appears and displays the transaction information, again informing Bob that his transaction has been completed and a receipt for the purchase has been sent to him by email. The page also displays payment details, a link to PayPal that Bob can use to view more transaction details if necessary, as well as links that he can use to continue shopping.
For example, as shown in the following diagram: Thank you for your payment. Your transaction has been completed, and a receipt for your purchase has been emailed to you. You may log into your account at www.paypal.com to view details of this transaction.
Step 8: Bob receives an email receipt for this transaction, confirming his purchase and including a copy of the payment details, the Widget Warehouse's business information, and his confirmed shipping address.
Enabling Payment Data Transfer
You can enable PDT from your account profile, and you can enable PDT when you use a button creation tool on the PayPal website to create payment buttons for Website Payments Standard.
For more information about enabling PDT from a button creation tool, see the Website Payments Standard Integration Guide.
To enable PD from your account profile:
1.
Click the My Account tab.
2.
Click the Profile subtab.
3.
Click the Website Payment Preferences link, as shown in the following snapshot.
The Website Payment Preferences page opens.
4.
Click the Payment Data Transfer On radio button, as shown in the following diagram.
You must enable Auto Return in order to use Payment Data Transfer. Auto Return can also be enabled from the Website Payment Preferences page.
5.
Click the Save button.
Getting and Using the Identity Token
When you click the Save button and save your PDT preferences, a message appears at the top of the page indicating that you have successfully saved your preferences. Your identity token also appears in this message.
You will need to pass this identity token, along with the transaction token, to PayPal in order to receive information that confirms that a payment is complete.
For security, the identity token is not sent to you; however, once you have enabled PDT, it permanently appears below the Payment Data Transfer On/Off radio buttons on the Website Payments Preferences page.
PDT and PayPal Account Optional
The PayPal Account Optional does not require your customers who are new to PayPal to create a PayPal account to complete a purchase—they go through an alternate checkout and 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.
PayPal Account Optional 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 the Continue button, 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 the Continue button, they will not be directed back to the merchant's site and PDT will not be initiated.
PDT Notification Synch
After you have activated PDT, every time a buyer makes a website payment and is redirected to your return URL, a transaction token is sent via a FORM GET variable to this return URL.
To properly use PDT and display transaction details to your customer, you should read the transaction token from the variable tx and retrieve transaction details from PayPal by constructing an HTTPS POST to PayPal. This is called notification synch or synchronization.
Constructing the POST
Here are the guidelines for constructing the PDT HTTPS POST to PayPal for notification synch:
1.
2.
cmd=_notify-synch
3.
You must include the transaction token in the variable tx and the value of the transaction token received via PayPal’s GET:
tx=value_of_transaction_token
4.
at=your_identity_token
For information about the identity token, see “Getting and Using the Identity Token”.
PayPal Response to POST
PayPal responds to the post with a single word on one line in the body of the response: SUCCESS or FAIL. When you receive a SUCCESS response, the rest of the body of the response is the transaction details, one per line, in the format key=value where key and value are both be URL-encoded strings. This response data needs to be parsed appropriately and then URL-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
custom=For+the+purchase+of+the+rare+book+Green+Eggs+%26+Ham
...
If the response is FAIL, PayPal recommends making sure that:
l
l
l
PDT and Auto Return: Messaging to Buyer
With Auto Return, you must display a message on the page displayed by the Return URL that helps the buyer understand that the payment has been made, that the transaction has been completed, and that payment transaction details will be sent to the buyer by email. You can display to your customer whatever payment details you feel are appropriate; however, PayPal recommends including the following:
l
l
l
l
If you are using PDT to determine when to fulfill an order automatically, confirm that the payment_status is Completed, since the buyer could use methods such as eChecks that do not immediately clear.
For a list of PDT variables, see Appendix A, “IPN and PDT Variables.”
Preventing Fraud
In order to prevent fraud, PayPal recommends that your programs verify the following:
l
txn_id is not a duplicate to prevent someone from reusing an old, completed transaction.
l
receiver_email is an email address registered in your PayPal account, to prevent the payment from being sent to a fraudulent account.
l
Sample Code for PDT
Sample code for the following development environments is available on the PayPal website at https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-code.
l
l
l
l