Hello, I've been struggling with an issue for a few days now and I was hoping someone could help.
I bought a php script that allows me to create paypal adaptive payments. It works great, it's all set up.
My only issue is that I can't find the proper place to set my code so that it will make an update call to my php database. The problem with that is I'm not sure how to set up paypal url forwarding to forward them to a webpage where the php code could run, so I either have to give them what they paid for BEFORE they pay and cancel the sale if they choose not to continue on with the transaction(which is my current problem)
Call the code to update my database after I receive the transaction complete from POST data (which is what I would like to do.)

I have 3 scripts. Buy.php which handles the actual transaction Paypal_API script which has the method definitions within it, and an IPN script which has the IPN listener within.

Which three of these scripts should I place the code to update my database? I've tried placing it inside all three at various places, it doesn't seem to work in the IPN script at all, and the other two scripts give me the first problem I mentioned.
Any help would be greatly appreciated and you might just win the "internets".