If you use the standard PayPal Standard buttons, you can use the "Transfer billing information" . Just provide the return URL in the return parameter, and the PDT will return the transaction information. You also need to enable automatic return to your PayPal account.
If you use express verification, after completing Doexpresscheckout you will receive all the necessary information, including transaction information, in response. alternatively, call the GetTransactionDetails API to get transaction information.
In addition, if not on the return page, you can always use IPN to get transaction details that are asynchronous. This is really the recommended way to process any transaction after a transaction that you may need, as it will allow you to correctly process pending payments that may not be cleared for several days.
source share