1
votes

I have implemented an IPN listener in VBScript/Classic ASP. From my side, it seems to work perfectly. When it is called, it sends the message back to Paypal appending cmd=_notify-validate. It then checks the response for objHttp.status = 200 and objHttp.responseText = "VERIFIED" then adds the order to my database.

However Paypal are sending me emails;

Subject: PayPal Instant Payment Notification Warning

Instant Payment Notifications sent to the following URL(s) are failing:

1
Does PayPal expect a specific response from your page perhaps that you are not sending back as an acknowledgement the response has been processed?user692942
@Lankymart Having investigated further, it seems there is a discrepancy between what some of the Paypal documentation says needs to be done (After receiving the IPN message from PayPal, your listener returns an empty HTTP 200 response to PayPal. Otherwise, PayPal resends the IPN message.) and the code samples Paypal give, in which this step isn't performed. Is this step required? And if so, can anyone give me a code example in VBScript/Classic ASP showing how to do it?Antony Meadley
Is this the code sample you are using? - paypal/ipn-code-samplesuser692942
From the documentation it does look like you are missing step 2 - "After receiving the IPN message from PayPal, your listener returns an empty HTTP 200 response to PayPal. Otherwise, PayPal resends the IPN message.".user692942
@Lankymart Yes, that is exactly the code sample which I used.Antony Meadley

1 Answers

0
votes

According to IPN Testing

Every listener must include code that handles the "error notification" IPN messages.

Either way you should follow the steps in the IPN troubleshooting tips step by step.

Here is a few I've picked out that should help.

  • Check the URLs listed in your IPN history to ensure that PayPal is posting each IPN to your listener.
  • Check your web server's access and error logs.
  • Check your programming language's error log.
  • Verify that your IPN listener is responding to all messages, even those you do not intend to process.

Further to the OPs comments

the code samples Paypal give, in which this step isn't performed. Is this step required?

it sounds like you are missing Step 2 from the workflow in the documentation

2. After receiving the IPN message from PayPal, your listener returns an empty HTTP 200 response to PayPal. Otherwise, PayPal resends the IPN message.

Judging by the PHP sample as well both seem to send the verification first, which doesn't tally with the workflow suggested by the documentation.

In which case you should just be able to do

Response.Status = "200 OK"

after the rest of the code, make sure nothing else is written back using Response.Write() so the server response is blank, you could even use

Call Response.Clear()

before setting the Response.Status to make sure nothing else has been written from the Response buffer. This will only work however if Response.Buffer has been set to True beforehand (usually at the beginning of the script).