Jump to content


Photo

DNS Error all of a sudden


  • This topic is locked This topic is locked
No replies to this topic

#1 olliec

olliec

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 01 February 2003 - 04:00 PM

Hello,

I had a nice IPN notify asp page going. I was using EliteWeaver's test page to debug it. My ISP migrated me to a new server machine and now it does not validate from the test page. The new machine supports VB.Net but I don't know what might have changed. I don't know what to ask even.

I keep getting the DNS Not Found! for the HTTP Status message on the test page. I don't think I changed a thing. I was sure I had this nailed down. any ideas?? Here's the code. It's EliteWeaver's framwork with a little database stuff, I create a password and some emails thrown in. There is a For Next for num_cart_items. Thanks!

<%@Language=VBScript%><%
'// IPN Posting Modes; Choose: 1, 2, 3 or 4

PostMode = "3"

'//* 1 = Live Via PayPal Network Non-Secure
'//* 2 = Live Via PayPal Network SSL-Secure
'//* 3 = Test Via EliteWeaver UK Non-Secure
'//* 4 = Test Via EliteWeaver UK SSL-Secure

Dim objHttp, IPN
IF PostMode = "1" THEN

'// Live Via PayPal Network Non-Secure
WebUrl = "http://www.paypal.com/cgi-bin/webscr"
SdHost = "www.paypal.com"

ELSEIF PostMode = "2" THEN

'// Live Via PayPal Network SSL-Secure
WebUrl = "https://www.paypal.com/cgi-bin/webscr"
SdHost = "www.paypal.com"

ELSEIF PostMode = "3" THEN

'// Test Via EliteWeaver UK Non-Secure
WebUrl = "http://www.eliteweaver.co.uk/testing/ipntest.php"
SdHost = "www.eliteweaver.co.uk"

ELSEIF PostMode = "4" THEN

'// Test Via EliteWeaver UK SSL-Secure
WebUrl = "https://ssl.uksecurewebhosting.net/~elitew/testing/ipntest.php"
SdHost = "ssl.uksecurewebhosting.net"

ELSE

'// Selected PostMode was Probably Not Set to 1, 2, 3 or 4
Response.Write ("PostMode: " &(PostMode) & " is invalid!")

END IF

IPN = Request.Form
IPN = "cmd=_notify-validate&" & IPN

Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")
objHTTP.Open "POST", WebUrl, False
objHTTP.setRequestHeader "Host", SdHost
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.setRequestHeader "Content-Length", Len(IPN)
objHTTP.Send IPN
Dim Status, Result

Status = objHttp.Status
Result = objHttp.ResponseText

IF (Status <> 200 ) THEN

'Begin Send a Problem Email to Customer
Dim objCDO1
Set objCDO1 = Server.CreateObject("CDONTS.NewMail")
objCDO1.From = "ollie.costello@aspentech.com"
objCDO1.To = "ollie.costello@aspentech.com"
objCDO1.Subject = "A Problem Was Encountered With Your PayPal Puchase from BigBendMaps.com"
objCDO1.Body = "A problem occurred while processing your transaction. Check your PayPal account to make sure " & _
"all your entries were correct. If you encounter further problems send an email to: webmaster@bigbendmaps.com" & chr(10) & _
"Thank you."
objCDO1.Send()
Set objCDO1 = Nothing
'End email section

ELSE

'// Standard - Instant Payment Notifiction Variables (Localization)

Receiver_Email = Request.Form("receiver_email")
Item_Name = Request.Form("item_name")
Item_Number = Request.Form("item_number")
Quantity = Request.Form("quantity")
Invoice = Request.Form("invoice")
Custom = Request.Form("custom")
Option_Name1 = Request.Form("option_name1")
Option_Selection1 = Request.Form("option_selection1")
Option_Name2 = Request.Form("option_name2")
Option_Selection2 = Request.Form("option_selection2")
Num_Cart_Items = Request.Form("num_cart_items")
Payment_Status = Request.Form("payment_status")
Pending_Reason = Request.Form("pending_reason")
Payment_Date = Request.Form("payment_date")
Payment_Date = mid(Payment_Date,1,21)
Payment_Date = dateadd("h",2,Payment_Date)
Settle_Amount = Request.Form("settle_amount")
Settle_Currency = Request.Form("settle_currency")
Exchange_Rate = Request.Form("exchange_rate")
Payment_Gross = Request.Form("payment_gross")
Payment_Fee = Request.Form("payment_fee")
Mc_Gross = Request.Form("mc_gross")
Mc_Fee = Request.Form("mc_fee")
Mc_Currency = Request.Form("mc_currency")
Txn_Id = Request.Form("txn_id")
Txn_Type = Request.Form("txn_type")
First_Name = Request.Form("first_name")
Last_Name = Request.Form("last_name")
Address_Street = Request.Form("address_street")
Address_City = Request.Form("address_city")
Address_State = Request.Form("address_state")
Address_Zip = Request.Form("address_zip")
Address_Country = Request.Form("address_country")
Address_Status = Request.Form("address_status")
Payer_Email = Request.Form("payer_email")
Payer_Id = Request.Form("payer_id")
Payer_Status = Request.Form("payer_status")
Payment_Type = Request.Form("payment_type")
Notify_Version = Request.Form("notify_version")
Verify_Sign = Request.Form("verify_sign")


IF (Result = "VERIFIED") THEN

For i=1 to num_cart_items

dim adocon
dim SQL,sConnString
sql=("INSERT INTO orders1 (receiver_email,Item_Name,num_cart_items,item_number,quantity,invoice," & _
"Payment_Status, payer_email,First_Name,Last_Name,Address_Street," & _
"Address_City,Address_State,Address_Zip,Address_Country,Address_Status,Payment_Type,Notify_Version," & _
"Verify_Sign,Payment_Gross,Payment_Fee,Payment_Date)" & _

"VALUES ('" & receiver_email & "','" & _
item_name & _
"'," & _
num_cart_items & _
"," & _
item_number & _
"," & _
quantity & _
",'" & _
invoice & _
"','" & _
Payment_Status & _
"','" & _
Payer_Email & _
"','" & _
First_Name & _
"','" & _
Last_Name & _
"','" & _
Address_Street & _
"','" & _
Address_City & _
"','" & _
Address_State & _
"','" & _
Address_Zip & _
"','" & _
Address_Country & _
"','" & _
Address_Status & _
"','" & _
Payment_Type & _
"','" & _
Notify_Version & _
"','" & _
Verify_Sign & _
"'," & _
Payment_Gross & _
"," & _
Payment_Fee & _
",'" & _
Payment_Date & _
"')")

'update orders table
sConnString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("fpdb/orders.mdb") & ";"
Set adocon = Server.CreateObject("ADODB.Connection")
adocon.Open(sConnString)
adocon.execute(sql)
adocon.close
Set adocon= nothing

Next

'create password
Set fs = CreateObject("Scripting.FileSystemObject")
'Get just the filename part of the temp name path
strTemp = fs.GetBaseName(fs.GetTempName)
'Hack off the 'rad'
strTemp = Right(strTemp, Len(strTemp) - 3)
Set fs = Nothing

'update customers table with Username and Password
sql2 = "Insert Into Customers (username, password) Values ('" & payer_email & "','" & strTemp & "')"
sConnString2="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("fpdb/customers.mdb") & ";"
Set adocon2 = Server.CreateObject("ADODB.Connection")
adocon2.Open(sConnString2)
adocon2.execute(sql2)
adocon2.close
Set adocon2= nothing

'Begin Send an Email to Customer
Dim objCDO2
Set objCDO2 = Server.CreateObject("CDONTS.NewMail")
objCDO2.From = "ollie.costello@aspentech.com"
objCDO2.To = "ollie.costello@aspentech.com"
objCDO2.CC = "ollie.costello@aspentech.com"
objCDO2.Subject = "Your BigBendMaps.com PayPal Purchase!"
objCDO2.Body = "Thank you for your purchase of the BigBendMaps.com Map Set!" & chr(10) & _
"The entire data set is now available for viewing and download." & chr(10) & _
"If you also ordered the data sent to you on CD allow two weeks for shipping." & chr(10) & chr(10) & _
"To LogIn go to www.BigBendMaps.com and select the Registered Users Login Link in the upper left hand corner of the Home Page." & chr(10) & chr(10) & _
"Your BigBendMaps.com Username is:" & chr(10) & chr(10) & _
payer_email & chr(10) & chr(10) & _
"Your password is:" & chr(10) & chr(10) & _
strTemp & chr(10) & chr(10) & _
"After logging in you will be taken to the BigBendMaps.com Download Page where all the data files will be permanently available for download or viewing." & chr(10) & _
"When you come back to the site after your initial visit just LogIn again from the BigBendMaps.com Home Page to go back to the Download Page." & chr(10) & _
"You can change your site password at any time from this page. Your site Username cannot be changed." & chr(10) & _
"If you experience any difficulty logging in or at any time please send an email to: webmaster@BigBendMaps.com."
objCDO2.Send()
Set objCDO2 = Nothing

ELSEIF (Result = "INVALID" OR Result = "Failed") THEN

'// Check your code for any Post back Validation problems
'// Investigate the Fact that this Could be a spoofed IPN
'// If updating your DB, Ensure this "txn_id" is Not a Duplicate

'Begin Send a Problem Email to Customer
Dim objCDO3
Set objCDO3 = Server.CreateObject("CDONTS.NewMail")
objCDO3.From = "ollie.costello@aspentech.com"
objCDO3.To = "ollie.costello@aspentech.com"
objCDO3.Subject = "A Problem Was Encountered With Your PayPal Puchase from BigBendMaps.com"
objCDO3.Body = "A problem occurred while processing your transaction. Check your PayPal account to make sure " & _
"all your entries were correct. If you encounter further problems send an email to: webmaster@bigbendmaps.com" & chr(10) & _
"Thank you."
objCDO3.Send()
Set objCDO3 = Nothing
'End email section

ELSE

'Begin Send a Problem Email to Customer
Dim objCDO4
Set objCDO4 = Server.CreateObject("CDONTS.NewMail")
objCDO4.From = "ollie.costello@aspentech.com"
objCDO4.To = "ollie.costello@aspentech.com"
objCDO4.Subject = "A Problem Was Encountered With Your PayPal Puchase from BigBendMaps.com"
objCDO4.Body = "A problem occurred while processing your transaction. Check your PayPal account to make sure " & _
"all your entries were correct. If you encounter further problems send an email to: webmaster@bigbendmaps.com" & chr(10) & _
"Thank you."
objCDO4.Send()
Set objCDO4 = Nothing
'End email section

END IF
END IF

Set objHTTP = Nothing

  • xxkalliy likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users