I have a website which is written in VB.Net/Asp.Net and it has an IPN Listener (Code Below). It has worked for the last 6 months but now it has stopped and shows that transactions are 'Retrying' in PayPal's IPN Listener History. I don't know what to change or do if anyone can please help? Imports System.Net Imports System.IO Imports System.Web.Util Imports System.Data.Common
Partial Class IPNListener
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
'Post back to either sandbox or live
'Dim strURL As String = "https://www.sandbox.paypal.com/cgi-bin/webscr"
Dim strURL As String = "https://www.paypal.com/cgi-bin/webscr"
Dim req As HttpWebRequest = CType(WebRequest.Create(strURL), HttpWebRequest)
'Set values for the request back req.Method = "POST" req.ContentType = "application/x-www-form-urlencoded" req.Proxy = New WebProxy("ntproxyus.lxa.perfora.net", 3128)
Dim Param() As Byte = Request.BinaryRead(HttpContext.Current.Request.ContentLength)
Dim strRequest As String = Encoding.ASCII.GetString(Param) strRequest = strRequest + "&cmd=_notify-validate" req.ContentLength = strRequest.Length
'Send the request to PayPal and get the response
Dim streamOut As StreamWriter = New StreamWriter(req.GetRequestStream(), Encoding.ASCII) streamOut.Write(strRequest) streamOut.Close()
Dim streamIn As StreamReader = New StreamReader(req.GetResponse().GetResponseStream())
Dim strResponse As String = streamIn.ReadToEnd() streamIn.Close()
Dim qscoll As NameValueCollection = HttpUtility.ParseQueryString(strRequest)
'Insert the paypal response
Dim order As New orders
order.InsertPaypalResponse(qscoll("txn_id"), qscoll("custom"), strRequest)
If strResponse = "VERIFIED" Then order.UpdateOrderFromPaypal(qscoll("custom"), qscoll("txn_id"), qscoll("payment_status"))
ElseIf strResponse = "INVALID" Then
'log for manual investigation order.UpdateOrderFromPaypal(qscoll("custom"), qscoll("txn_id"), qscoll("payment_status"))
Else
'Response wasn't VERIFIED or INVALID, log for manual investigation order.UpdateOrderFromPaypal(qscoll("custom"), qscoll("txn_id"), qscoll("payment_status"))
End If
End Sub
End Class
... View more