user3878719
user3878719

Reputation: 37

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?

Upvotes: 1

Views: 6999

Answers (2)

Vimalnath
Vimalnath

Reputation: 6463

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)

Upvotes: 1

Drew Angell
Drew Angell

Reputation: 26036

PDT is nice, but only for display purposes. If you need to use that transaction ID to update your database, send emails, etc. you'll want to use IPN instead, which is very similar to PDT except that the data will always be POSTed to your IPN listener, where-as with PDT, even if Auto-Return is enabled, there is no guarantee the user will make it back to your page.

Upvotes: 0

Related Questions