hey, this is very complicated, well, it was for me anyway, i went around it alittle different.
I got the client to fill out a form with all the details, then put it in a database, at the same time i generated a random ID and took there IP Address, the table was then marked with a STAGE OF 0
The client would then go through the paypal process then come back to my website onto a completion page, where i would then take the random ID out of a cookie, and match it to the database with the IP and if there was one matching a STAGE OF 0, i then update the table to a STAGE OF 1 = active.
Its a pretty simple way to do it, it works great for me.
PayPal IPN AND PDT just didnt cut it for me