Payment Data Transfer
Payment Data Transfer (PDT) is a secure method to retrieve the details about a PayPal transaction so that you can display them to your customer. It is used in combination with PayPal Payments Standard, so that after a customer returns to your website after paying on the PayPal site, they can instantly view a confirmation message with the details of the transaction. PDT is not meant to be used with credit card or Express Checkout transactions. This page describes how PDT works and how to configure your account to use PDT.
How PDT Works
When a customer pays you, PayPal sends the transaction ID of the payment to you by appending the transaction ID to a URL you specify in your account Profile. This information is sent through an HTTP
GET request as the
tx=transactionID name and value pair:
After you get the transaction ID, you post a FORM to PayPal that includes the transaction ID and your identity token, a string value that identifies your account to PayPal. The following instructions describe how to get your identity token. The form looks like this:
<form method=post action="https://www.paypal.com/cgi-bin/webscr"> <input type="hidden" name="cmd" value="_notify-synch"> <input type="hidden" name="tx" value="TransactionID"> <input type="hidden" name="at" value="YourIdentityToken"> <input type="submit" value="PDT"> </form>
In PayPal's reply to your post, the first line is
FAIL. A successful response looks like this, with the HTTP header omitted:
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 contains the word FAIL, make sure that the transaction ID token and identity token on your post are correct. PayPal was not able to validate the transaction.
For a list of all variables and values that PayPal can return to you, see the IPN/PDT Variable Reference.
This diagram shows the basic flow of a PDT transaction.
To use PDT, you must activate PDT and Auto Return in your PayPal account profile. You must also acquire a PDT identity token, which is used in all PDT communication that you send to PayPal.
To configure your account for PDT:
- Log in to your PayPal account.
- In your Profile, choose My Selling Tools on the left.
- Click Update for Website Preferences.
- In Auto Return for Website Payments, click the On option.
- For the return URL, enter the URL on your site that will receive the transaction ID posted by PayPal after a customer payment.
- In Payment Data Transfer, click the On option.
- Click Save.
- Repeat steps 2 and 3.
- To view your PDT identity token, scroll down to the Payment Data Transfer section on the page.
- To discuss issues and share ideas, visit the PayPal stackoverflow forum.