Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paypal IPN Verification

Status
Not open for further replies.

hdog

Technical User
Mar 24, 2002
26
US
I am building a verification page that will post back the IPN string from Paypal as one part of the validation process. I am writing my code in jscript which is embedded in an asp page. I am stumped on how the page automatically posts the IPN string back to Paypal. I found some code on the Paypal site that does just this but it appears it is written in Java, not Jscript and I don't know how to write anything equivalent. Can anyone help me?

Here is the portion of the code I am stumped on:

// post back to PayPal system to validate
// NOTE: change http: to https: in the following URL to verify using SSL (for increased security).
// using HTTPS requires either Java 1.4 or greater, or Java Secure Socket Extension (JSSE)
// and configured for older versions.
URL u = new URL("URLConnection uc = u.openConnection();
uc.setDoOutput(true);
uc.setRequestProperty("Content-Type","application/x-PrintWriter pw = new PrintWriter(uc.getOutputStream());
pw.println(str);
pw.close();
 
that is their java/jsp code example.

technically you probably could do it in javascript using XmlHttp in IE or XmlHttpRequest in Mozilla, but you'll probably want to use some sort of server-side language such as jsp or php if you're going to be processing paypal payments. this way any sensitive information won't be available via view-source, and furthermore you won't have database connectivity readily available with javascript


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Thanks for the reply jemminger!

Do you have any sample code you could post in jsp?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top