SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: IPN and PayPal

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    IPN and PayPal

    Hello!

    I'm hoping that I'm doing something really dumb but I can't seem to get PayPal to talk with my IPN listener. After being on the phone with them, showing them my code, and not getting a positive result, I thought I'd bring things over here to get a fresh perspective. To send things off to Paypal, I use:

    <form action="https://www.paypal.com/cgi-bin/webscr" method="POST">
    <input type ="hidden" name="cmd" value="_xclick" />
    <input type = "hidden" name="business" value ="support@itsmorethanatextbook.com" />
    <input type="hidden" name="item_name" value="Test_1" />
    <input type="hidden" name="item_number" value="1" />
    <input type="hidden" name="amount" value="0.01"/>
    <input type="hidden" name="no_note" value="1"/>
    <input type="hidden" name="currency_code" value="USD"/>
    <input type="hidden" name ="lc" value="US"/>
    <input type="hidden" name="bn" value="PP-BuyNowBF"/>
    <input type="hidden" name ="return" value="http://www.itsmorethanatextbook.com/Homepage_extras/welcome_message.php?book_id=Test_1" />
    <input type="hidden" name="cancel_return" value="http://www.itsmorethanatextbook.com/books/Test_1/homepage/index.php"/>
    <input type="hidden" name="rm" value="2" />
    <input type="hidden" name="notify_url" value="http://www.itsmorethanatextbook.com/ipn/ipn.php"/>
    <input type="hidden" name="custom" value="7"/>
    <p><input type="submit" value="Off to PayPal"/></p>
    </form>

    In theory, then, the user should be directed to my IPN script after a transaction. Currently in that script, I just print "Hello!" to the screen (I'll be doing some database stuff when PayPal actually sends the user there), but I fear that after a transaction, PayPal doesn't redirect to that script, it just happily accepts the payment.

    Trouble shooting that I've done:

    1) I've double and triple checked that IPN is enabled on Paypal and that my IPN script is the script that it gets sent to.
    2) I've looked at the IPN history and it appears that something is in fact being posted.
    3) I've contacted my service provider and they say that nothing's wrong on their end. (Actually, they didn't really "check" anything, they just said that there's no way it's their fault)

    Is there some silly detail that I could be overlooking, such as some setting that would override the IPN behavior?

    Any help would be appreciated...

    Thank you,

    Eric
    Last edited by HAWK; Oct 22, 2012 at 18:29.

  2. #2
    Non-Member
    Join Date
    Jun 2012
    Posts
    88
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Is there some silly detail that I could be overlooking, such as some setting that would override the IPN behavior?
    It would help if you post the code in your ipn.php script.

    In it you should have a php fsockopen statement which sends the data received by your ipn listener script (ipn.php) back to paypal for verification that the received data actually came from paypal and not from somewhere else.

    Not all ISP's enable fsockopen by default on their clients' hosting accounts for security reasons. So the first thing I would do is check with your ISP if fsockopen is enable on the hosting account that is hosting your website and ipn.php script.

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the response. It turned out that there WAS a problem with my script. However, it wasn't until I did more googling to learn that error messages had to logged as opposed to printed to the browser that I was able to properly debug. Now that I better understand the IPN process (talking to my server as opposed to going to the browser), this piece makes sense, but I sure wish that I knew about this piece when I was attempting to debug!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •