Q:

how to generate a one-time token url after paypal payment?

I am creating virtual currency, say if a customer completes a payment so we can redirect them to a particular page say www.example.com/generate10coins,but it should be fool-proof since the customer can easily keep refereshing the page and keep creating more tokens.

A:

save a hashed token in your db after the payment.
then redirect the user to a url with the token as $_GET data
then when the page is first reached save the activity in the database as complete.
each time the page, e.g. redirect.php?token=generate10coins, is reached or refreshed make a db query to check if the token is complete or not.

