I have a simple page with a simple PayPal Buy button on the page. When a person buys an item, and completes the purchase on PayPal, they will be returned to a thank-you page.
In order to NOT have people access the thank-you page if they have not actually purchased anything, I would like to give every user a unique ID in the return url and use it as a url_segment.
When the user returns, the url will look like www.domain.com/thank-you/34567654
In the template I could do something like:
{if current_id != segment_2}
{redirect='/'}
{/if}
Does something like this exist?
I know how to pass the option in the PayPal return url, but can one generate a unique user id (session id) and compare it like in my example. Use it as a template var?