Search code examples
paypalpaypal-ipnpaypal-sandbox

Adding Transaction ID to Return URL in PayPal?


I currently have this in the code for my PayPal button:

<input type="hidden" name="return" value="http://www.mywebsite.com/successful.php">

However, I need to reference the transaction ID # in the URL itself.

I'd like users to be sent to a URL that looks like this:

http://www.mywebsite.com/successful.php?transaction=3j4kn543jkn435n

Is there any way to simply update the value of the return URL to have this added without needing to actually make any changes in my account related to IPN or PDT?


Solution

  • When you use PDT, the transaction id is automatically returned back to you in GET appended to your RETURN URL.

    enter image description here

    P.S As Andrew mentioned it is always nicer to use IPN which is more reliable and guaranteed unlike PDT(

    • which does not work for Credit card payments
    • if buyer closes the checkout page before being re-directed to your website)