<% 'dim ids() 'redim ids(request("num_cart_items")) ' read post from PayPal system and add 'cmd' str = Request.Form & "&cmd=_notify-validate" 'Response.write "Str=" & str & "
" ' post back to PayPal system to validate set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") ' set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0") ' set objHttp = Server.CreateObject("Microsoft.XMLHTTP") objHttp.open "POST", "https://www.sandbox.paypal.com/cgi-bin/webscr", false objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded" objHTTP.setRequestHeader "Content-Length", Len(str) objHttp.Send str if (objHttp.status <> 200 ) then ' HTTP error handling Response.write "An Error Occured" elseif (objHttp.responseText = "VERIFIED") then ' level_ids=Request("custom") ' i=0 ' while not Instr(level_ids,"@") = 0 ' ids(i)=Mid(level_ids,1,Instr(level_ids,"@")-1) ' level_ids=Right(level_ids,len(level_ids)-Instr(level_ids,"@")) ' i=i+1 ' wend ' ids(i)=level_ids if request("Payment_Status") ="Completed" then paymentdate=FormatDateTime(date(),2) sqlquery = "Insert into h_payment (status) values (true)" 'response.write(sqlquery) 'response.flush() Conn.Execute(sqlquery) sqlquery1 = "Insert into h_bookinfo (status) values (true)" 'response.write(sqlquery) 'response.flush() Conn.Execute(sqlquery1) response.Redirect("msg.asp?error=Congratuation, Your booking has been done successfully") set rs_inout=server.CreateObject("adodb.recordset") sql="select * from in_out" rs_inout.open sql,conn,1,3 else response.Redirect("msg.asp?error=Your Payment is not completed") end if else response.Redirect("msg.asp?error=Error on receiving information, please contact to Admin") end if %>