locked
Paypal IPN handler RRS feed

  • Question

  • User-1667098871 posted

    Hi all,

    Im having trouble with my Paypal IPN handler. It runs through to a certain point and simply doesnt get any further. Any ideas:

     

      Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Response = context.Response
        Request = context.Request
        
        [Global].writeToDebugFile("PayPalIPN: ProcessRequest Entered")
        Try
          If IsVerifiedNotification() Then
            <process order>
    
          End If
        Catch Ex As Exception
          [Global].writeToDebugFile(String.Format("PaypalIPN: {0}", Ex.Message & Ex.InnerException.Message & Ex.StackTrace))
        End Try
        [Global].writeToDebugFile("PayPalIPN: ProcessRequest Exited")
        
      End Sub
    
    
      
      Protected Function IsVerifiedNotification() As Boolean
        [Global].writeToDebugFile("PayPalIPN: IsVerifiedNotification Entered")
        Dim R As String = String.Empty
        Dim Post As String = Request.Form.ToString() & "&cmd=_notify-validate"
    
    
        [Global].writeToDebugFile("*** THIS LINE IS EXECUTED ***")
        Dim Req As HttpWebRequest = DirectCast(WebRequest.Create("https://www.paypal.com/cgi-bin/webscr"), HttpWebRequest)
        [Global].writeToDebugFile("*** THIS LINE IS NEVER EXECUTED ***")
        
        Req.Method = "POST"
        Req.ContentType = "application/x-www-form-urlencoded"
        Req.ContentLength = Post.Length
        
    
        Dim Writer As New StreamWriter(Req.GetRequestStream(), System.Text.Encoding.ASCII)
        Writer.Write(Post)
        Writer.Close()
       
        Dim Reader As New StreamReader(Req.GetResponse().GetResponseStream())
        R = Reader.ReadToEnd()
        Reader.Close()
        
        Return R = "VERIFIED"
        [Global].writeToDebugFile("PayPalIPN: IsVerifiedNotification Exited")
        
      End Function
      
    
    The debug that gets written is :-
    "PayPalIPN: ProcessRequest Entered"
    "PayPalIPN: IsVerifiedNotification Entered"
    "*** THIS LINE IS EXECUTED ***"
    so the line immediately after is the problem, although I can't see how, and it raises no exception either???
     
     
    Any help gratefully recieved. Whats left of my hair is being pulled out right now.
     
    Cheers,
    BBM 


     

    Friday, February 19, 2010 1:18 PM

Answers

  • User-1667098871 posted

    This was all down to permissions on my server! 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 16, 2010 6:08 AM

All replies

  • User-341952562 posted

    I don't know whether the following will help you

    http://www.3bbb3.com

    Tuesday, March 9, 2010 8:12 AM
  • User-1667098871 posted

    This was all down to permissions on my server! 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 16, 2010 6:08 AM