YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Sample code not working Options
midntrdr
#1 Posted : Saturday, March 22, 2003 11:07:03 PM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
I have taken the sample code provided an turned it into a servlet (my host doesn't support JSP). Basically just put the sample code into my "doPost". Shouldn't be any problems there. The sample code doesn't seem to be working. If I test it myself I basically get no response from my servlet. Now I have started testing it at http://www.eliteweaver.co.uk/testing/ipntest.php It says that my script isn't responding. I put in some trace messages to see if I could pinpoint where something was going wrong. Used the follow ipn button and got my trace messages to tell me that I was getting a "INVALID" response. But if I test it by sending money I don't get a "INVALID" response. It's like I get no response at all? If anyone has had expierence with similar problems or can help in anyway I would be very greatful!!! I'm getting frustrated.
Sponsor  
 
midntrdr
#2 Posted : Monday, March 24, 2003 7:16:11 PM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
Anyone?????? Any Java people out there?
paypal_pb
#3 Posted : Monday, March 24, 2003 8:48:28 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
A simple way to test your script: http://www.paypaldev.org/topic.asp?TOPIC_ID=1658

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
midntrdr
#4 Posted : Tuesday, March 25, 2003 12:53:08 AM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
can I change variables like payer and reciever emails?
midntrdr
#5 Posted : Tuesday, March 25, 2003 1:11:53 AM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
Ok, if I post the form you are suggesting I get a VERIFIED response. But of course I am that form sends the script exact values. If I make an actual payment through paypal I get nothing! Not Verified or invalid just no response. If I test it with that eliteweaver script I get an invalid response and it says my script is not responding. Anything will work if you send it exactly what it's looking for in hidden fields. This is getting really frustrating because I originally wanted to go with paypal because I figured it would be a quick and easy process. That form you suggested isn't a good way to test because it isn't tesing the script its just assigning variables regardless of whether the post back to paypal works. This sample code to post back to paypal, has it really been tested and proven to work?
midntrdr
#6 Posted : Tuesday, March 25, 2003 1:32:28 PM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
Ok, I thought maybe it was my servlet engine. My host is using jserv which is horribly outdated and I think it uses jdk 1.1 which maybe some of the sample code isn't compatible with that jdk.

NOPE!! Just ran the same code at work on two different servers. One was JRun 3.1 using jdk 1.3 and the other is Bea Weblogic running jdk 1.4. Guess what? Same problem, script doesn't respond. The post back to paypal doesn't work.

Can anyone help please??????????
midntrdr
#7 Posted : Tuesday, March 25, 2003 1:55:43 PM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
I took the exact code provided by paypal and ran it as a JSP on Bea Weblogic and JRun. Much to my surprise, that doesn't even work.
paypal_pb
#8 Posted : Tuesday, March 25, 2003 5:51:16 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
The POST on http://www.paypaldev.org/topic.asp?TOPIC_ID=1658 simulates nearly identically what happens in IPN. You need to modify the "action" to the URL of *your* script.

The JSP sample code has been tested on mycgiserver.com.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
midntrdr
#9 Posted : Friday, March 28, 2003 1:06:43 PM
Rank: Starting Member

Groups: Registered

Joined: 3/22/2003
Posts: 8
Location: ,
I finally got this working! Sorry for ranting and raving that the code doesn't work. It was a problem in my conversion of it to a servlet.
OrderFormCity
#10 Posted : Monday, May 12, 2003 4:19:45 PM
Rank: Starting Member

Groups: Registered

Joined: 5/12/2003
Posts: 7
Location: ,
Yes. OrderFormCity.com

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by midntrdr
[br]Anyone?????? Any Java people out there?
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Aggregate client side invoicing. Customized shipping and quantity adjusted rates.
Add the power of Java to your shopping cart.
jholme
#11 Posted : Friday, June 13, 2003 6:53:27 PM
Rank: Starting Member

Groups: Registered

Joined: 6/13/2003
Posts: 16
Location: ,
midntrdr,

I'm getting ready to access IPN via a Servlet, and I'm curious to know exactly what the problem was when you converted the sample JSP code to Servlet code.

thanks,
John

John Holme
J2EE UI Developer
paypal_pb
#12 Posted : Monday, June 16, 2003 7:07:35 PM
Rank: Starting Member

Groups: Registered

Joined: 9/16/2002
Posts: 2,960
Location: ,
I suspect a typo or bug and nothing inherent to servlets.

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn
richy
#13 Posted : Sunday, January 18, 2004 2:39:51 AM
Rank: Starting Member

Groups: Registered

Joined: 1/18/2004
Posts: 2
Location: ,
midntrdr or anyone else,

can someone assist or send me a servlet code for the sample code?
i'm having a hard time trying to get it working...
also, if anyone has any advice on how to use IPN with struts?
thanks

email: teamrichy@hotmail.com
znaps
#14 Posted : Wednesday, January 21, 2004 1:41:53 PM
Rank: Starting Member

Groups: Registered

Joined: 1/21/2004
Posts: 4
Location: ,
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by richy
[br]midntrdr or anyone else,

can someone assist or send me a servlet code for the sample code?
i'm having a hard time trying to get it working...
also, if anyone has any advice on how to use IPN with struts?
thanks

email: teamrichy@hotmail.com
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Richy, I'm developing a Struts action. I'll post it up here when I'm done and sure it works correctly...but basically it's the same as the example code provided by Paypal for a Servlet, since Struts Actions are called from a Servlet.

In the webpage that contacts Paypal for the payment, you'll place something like &lt;input type="hidden" name="notify_url" value="http://myserver.com/myPaymentAction.do"&gt; so your Struts action class gets hit when the payment is processed by Paypal.

Boombastik
#15 Posted : Monday, February 16, 2004 2:27:25 PM
Rank: Starting Member

Groups: Registered

Joined: 2/16/2004
Posts: 3
Location: ,
znaps,

I'm also integrating Paypal with Struts. Progress is good, but I'm stuck on trying to get the initial form posted to the action forwarded to the external Paypal URL. The reason I post the form to the action is that I want to persist it (using hibernate).

Redirect works, but it's no good as the form data is lost...
Andy_Baptiste
#16 Posted : Wednesday, April 20, 2005 5:49:58 PM
Rank: Starting Member

Groups: Registered

Joined: 11/5/2003
Posts: 2
Location: ,
***if anyone can sort this out for me I'd be very even maybe 'financialy' grateful****


I'm adding IPN to a struts website also and can't get the sample code to work.

I think the jsp form that is submitted may work, its the servlet (struts action) that falls over when I reconnect to paypal to confirm:

// post back to PayPal system to validate
URL u = new URL("http://www.paypal.com/cgi-bin/webscr");
URLConnection uc = u.openConnection();
uc.setDoOutput(true);
uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
PrintWriter pw = new PrintWriter(uc.getOutputStream());

Its the final line above that falls over.

I'm getting www.paypal.com UnknownHostException

Tried with and without http.

Has anyone had and got over this?

Thanks People,

Andy

Andy
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.571 seconds.