6

I'm using dcramer's fork of django-paypal, but I always encounter an invalid IPN while working with my sandbox accounts.

I receive the following IPN:

Invalid postback. (INVALID)

I tried everything that showed up on google:

  • checked seller & buyer emails
  • sandbox accounts are both verified
  • I use form.sandbox to render the paypal form
  • tried removing custom values
  • there is no non-ascii character in the request

When manually checking the request with https://www.sandbox.paypal.com/cgi-bin/webscr, I also get INVALID.

Did someone encounter this issue ? Is there any more-verbose page to validate ipn requests ?

ldiqual
  • 15,015
  • 6
  • 52
  • 90

1 Answers1

-2

Yes, I also get errors on post-back starting yesterday (18 June):

Opened POST Back Socket to PayPal.
PayPal Post Back returns HTTP/1.0 400 Bad Request
Server: AkamaiGHost
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 216
Expires: Mon, 18 Jun 2012 22:18:00 GMT
Date: Mon, 18 Jun 2012 22:18:00 GMT
Connection: close

<HTML><HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD><BODY>
<H1>Invalid URL</H1>
The requested URL "&#47;cgi&#45;bin&#47;webscr", is invalid.<p>
....
</BODY></HTML>
: not handled.

I use my own IPN integration. It tries to handle all replies from PayPal, which is why I get the last message (: not handled.) I made a package upgrade yesterday, so I'm not quite sure it is a PayPal problem though.

  • Actually, I'm getting a proper `INVALID` response, which is just a raw text containing the word. I get no html like you do. However, I'll try to make my own ipn view to see if it works better. I see that django-paypal suppresses `N/A` dates in the POST parameters, it could be the reason. – ldiqual Jun 18 '12 at 22:52
  • 1
    Your problem is that you're missing a 'Host' header in your IPN script. Simply ensure you add a 'Host: www.paypal.com' HTTP header and it'll go through normally. – Robert Jun 19 '12 at 00:25