I have a paypal IPN script, im not good at Advanced PHP , i am beginner.. the script is attached. can you please make it to add a query to mysql if payment is verified??? the query should be according to this example: if (isset($_POST['submit'])) { mysql_query("insert into links (`linkname`, `linkurl`,`paid`) values ('test', 'http://test.com', 'n')"); // do the IPN script if(VERIFIED) { mysql_query("update table links set paid = 'y'"); } } PHP: this is just an example of my code.. now, i know my code works, but ... how will it know which row to update?? i mean how will it know which site's payment has been verified just now?? if you can help me, then ill be really glad Thanks
you can pass the site field name in the form on ur site as data and then by picking those transaction values you could find on which site payment was made. Regards Alex
you did not read what i wanted to do. i said i want a query to be ran, cuz i dont want to login to my account to verify every transaction manually..
Basically what you need to do is add another field for email address in your database. Then your IPN function you are using returns a value of $payer_email. You then do a query to find the row = $payer_email then update paid to = yes. Sorry I dont have time to write out the code but that is the way I would do it.
okay thanks, i got the point. but how does WHMCS or any other shopping cart scripts track the payment? I use WHMCS, and it doesnt use PayPal IPN to track the payment.. i mean, is there any other way to track payment? just becuz , i dont want to go messing around with my account's settings.. PayPal IPN needs to be configured VIA the paypal account to be working , and i dont want to edit any settings..
If u pay me i can help u $50 for fixing this problem 50% advance You wont need to login to ur paypal account to verify Regards Alex
You don't have to alter the paypal account to use IPN, set the notify URL for the response. All the information needed is in the IPN docs. Aaron_nimocks pointed you in the right direction. Considering this thread is 5 days old, it might be worthwhile to find someone to pay to do it.
yeah , i know he pointed me in right direction, but since im new at PHP, i cant understand it as you guys.. can you atleast tell me how to find the the payer's field in database an do a query upon payment validation ?? and what to write in <input type="hidden" name="notify_url" value="" /> ?? Please help !
How would I know what the database field is? You have to look at the db. Far as the field for notify url, it doesn't have to be a hidden field. The script should set it before it initiates the transaction with paypal's IPN.
so the return_url and notify_url should be same? and i am trying to do this: upon validation : update table links Set paid='y' PHP: and now comes the hard part. it should update the only row, whose payment has been validated just now, i think it should be done using the $_GET thingy, but i cant figure out how