code for IPN with paypal

could you send me sample code on how to update my database after somebody paid through paypal  so i can confirm if the payment was made.  
LVL 1
gianitooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lengreenCommented:
Hi THis is the code i use

 cheers

Len

<%@ LANGUAGE="VBSCRIPT" LCID="2057"%>      

<%

Dim authToken, txToken
Dim query
Dim objHttp
Dim sQuerystring
Dim sParts, iParts, aParts
Dim sResults, sKey, sValue
Dim i, result
Dim Firstname, lastName, itemName, mcGross, mcCurrency

authToken = "3Tw9HrVeMy0Xp_BfbcxXoGS_LapSKlwhdgfdfgdfggjfi04_Ob1XMF0CtfmTGE_gtzFbp8WS" '  your token
txToken = Request.Querystring("tx")

query = "cmd=_notify-synch&tx=" & txToken &"&at=" & authToken

set objHttp = Server.CreateObject("Microsoft.XMLHTTP")
' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "POST", "http://www.paypal.com/cgi-bin/webscr", false
objHttp.Send query

sQuerystring = objHttp.responseText

If Mid(sQuerystring,1,7) = "SUCCESS" Then
      sQuerystring = Mid(sQuerystring,9)
      sParts = Split(sQuerystring, vbLf)
      iParts = UBound(sParts) - 1
      ReDim sResults(iParts, 1)
      For i = 0 To iParts
            aParts = Split(sParts(i), "=")
            sKey = aParts(0)
            sValue = aParts(1)
            sResults(i, 0) = sKey
            sResults(i, 1) = sValue
            
            Select Case sKey
                  Case "first_name"
                  Firstname = sValue
                  Case "last_name"
                  lastName = sValue
                  Case "item_name"
                  itemName = sValue
                  Case "mc_gross"
                  mcGross = sValue
                  Case "mc_currency"
                  mcCurrency = sValue
            End Select
      Next

      Response.Write("<p><h3>Your order has been received.</h3></p>")
      Response.Write("<b>Details</b><br>")
      Response.Write("<li>Name: " & Firstname & " " & lastName & "</li>")
      Response.Write("<li>Description: " & itemName & "</li>")
      Response.Write("<li>Amount: " & mcCurrency & " " & mcGross & "</li>")
      Response.Write("<hr>")

      set Recordset1 = Server.CreateObject("ADODB.Recordset")      
      strQuery = "your update query"
      With Recordset1
            .ActiveConnection = strDBCONN
            .Source = strQuery
            .CursorType = 1
            .CursorLocation = 2
            .LockType = 3
            .Open
      End With
      if not Recordset1.EOF then
            response.write "Payment Accepted but could not complete account update " & Recordset1(0)
      end if
Else
      'log for manual investigation
      Response.Write("ERROR")
End If

%>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lengreenCommented:
have you tried?

cheers

Len
0
gianitooAuthor Commented:
i will soon. sory for the delay
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.