|
|
|
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.
|
|
|
|
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 3/22/2003 Posts: 8 Location: ,
|
Anyone?????? Any Java people out there?
|
|
|
|
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
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 3/22/2003 Posts: 8 Location: ,
|
can I change variables like payer and reciever emails?
|
|
|
|
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?
|
|
|
|
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??????????
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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 <input type="hidden" name="notify_url" value="http://myserver.com/myPaymentAction.do"> so your Struts action class gets hit when the payment is processed by Paypal.
|
|
|
|
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...
|
|
|
|
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
|
|
|
|
Guest
|