IPN simulator "Unable to retrieve response: Content-Type not found"

Since PayPal has made some changes to its developer APIs over the last couple of weeks, I noticed that the IPN sim in the developer center no longer responds to the IPN test, as I expected. Now he spits out the message:

"IPN delivery error: cannot retrieve response: Content-Type not found"

The test IPN itself seems to really work just fine - my IPN controller (in ASP) gets the IPN, repeats it, and PayPal answers "VERIFIED" as I expected.

Is this just a simulator interface error, or am I missing something? My code (as far as I can tell) definitely sends the ContentType header, as always:

req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; <-- ## HEADER IS PRESENT ## byte[] param = Request.BinaryRead(HttpContext.Request.ContentLength); string strRequest = Encoding.ASCII.GetString(param); strRequest += "&cmd=_notify-validate"; req.ContentLength = strRequest.Length; 

It is worth noting that I use nginx as a proxy to redirect IPN requests to the local development server, since the Microsoft development test server (very silly) is only available locally. I don’t know if this affected the result, but it worked just a week ago before PayPal changed.

Thank you very much in advance

+4
source share
1 answer

No - it looks like your IPN handler itself does not return the correct HTTP 200 response after receiving an IPN message from PayPal. Here is the sequence:

  • PayPal sends an IPN message
  • Your IPN handler receives an IPN message and returns HTTP 200 (no response).
  • Your IPN handler will send a POST message to PayPal for confirmation.

It seems like # 2 is where it doesn't work. I would recommend checking your IPN script to make sure it returns a successful response as soon as it receives an IPN message (even before sending the IPN for verification).

+2
source

Source: https://habr.com/ru/post/1469387/


All Articles