Hi. I read many tutorials how to integrate paypal IPN. However, I can't get it work. When someone purchases my item, I get money but paypal doesn't send that notification. What do I do wrong? Here's form: <form method="POST" action="https://www.paypal.com/cgi-bin/webscr" id="payPalForm"> <input type="hidden" name="item_number" value="01 - 500 Hero Town Credits" /> <input type="hidden" name="item_name" value="Hero Town Credits" /> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="business" value="***"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="amount" value="3.00" /> <input type="hidden" name="return" value="***" /> <input type="hidden" name="notify_url" value="***" /> <input type="hidden" name="cancel-return" value="http://www.hero-town.com/failed.php" /> <input type="hidden" name="rm" value="2" /> <input type="hidden" name="lc" value="US" /> <input type="hidden" name="currency_code" value="USD" /> <input type="hidden" name="player_id" value="***" /> <input type="submit" value="Pay with paypal" /> </form> Code (markup): Some pieces were hidden for security purposes. I know that all *** are correct. It's like paypal does not send me notification. Any suggestions?
You have to turn on the IPN feature in PayPal. URL given can be over-ridden by the button used. The only notice you will receive unless you have a script running is the standard one from PP. The value you need to set with your button link is: This will return the buyer to your site at the URL provided so that they can download what you sold them. Did I answer your question? or ask more.
I have always found it easiest when writing IPN scripts to test that the IPN script is working properly using Paypal's IPN testing tool. You need to create an account with Paypal Sandbox to access the tool - https://developer.paypal.com/. You can then enter the URL of your IPN script and some test data and it tests it and advises whether it worked etc. Jonathan
Since paypal does a callback and use POST on your script, You can debug it like so. ... ob_start(); print_r($_POST); file_put_contents('ipn.log', ob_get_contents()); ob_end_clean(); PHP:
one of your hidden inputs should be an IPN callback (and a success/cancel page).. This is the script location paypal calls to verify stuff. Your scripts need to pick up on that IPN request and validate it. Once everything is validated, paypal will send your customer to the success page, where you read in all the paypal post variables to double verify for your own purposes.
Are you saying that if I don't have added success and failed pages, Paypal won't send a notification?
I would have them in there anyway. Easier to track if stuff is working right. Also your customer has to know to click on the return to merchant site link after they made their purchase. I like to put a reminder right before the user is sent to paypal, reminding them of this fact.
well, I am just testing if I get notifications. That's why I haven't made success/cancel pages. Will do and let you know if it works or not.