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

Why the multiple replies? Options
prof611
#1 Posted : Wednesday, September 14, 2005 7:32:34 PM
Rank: Starting Member

Groups: Registered

Joined: 9/14/2005
Posts: 6
Location: ,
I have been playing in the Sandbox, trying to debug an ipn.cgi script. Every time I submit an order, Paypal sends back "several" replies to my script. This is annoying, since it clogs up the logfile in which I have been storing the replies. I could work around this, but it would involve retrieving information from my database about whether the previous reply for this transaction id was 'Pending'. I could also just ignore the problem, and write the new data in my databse on top of the old data. However, I would like to find out if there is a known way to prevent these multiple replies from happening. Any ideas? Professor http://www.professorsopportunities.com
Sponsor  
 
Andrew Chang
#2 Posted : Saturday, September 17, 2005 8:53:33 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2003
Posts: 738
Location: ,
IPN will keep sending untill it recieves a 200 ok responce. Make sure it is not sending an error responce.

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannouncements.com/affiliates http://scorpionwebhosting.com/affiliate
Free Web Traffic: http://www.trafficswarm.com/go.cgi?169137 , http://www.ts25.com/index.jsp?ref=ScorpionSystems
prof611
#3 Posted : Sunday, September 18, 2005 8:30:20 AM
Rank: Starting Member

Groups: Registered

Joined: 9/14/2005
Posts: 6
Location: ,
Thanks, Andrew. I seem to remember seeing that somewhere else in the forum, but it wasn't specific enough. Exactly how do you send a 200 OK response? I have googled around looking for an answer, and I have learned a bit about LWP, but I can't seem to find out how to do it.

I'm using the standard coding on my IPN page:

use LWP::UserAgent;
$ua = new LWP::UserAgent;
$req = new HTTP::Request 'POST','http://www.sandbox.paypal.com/cgi-bin/webscr';
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);
$res = $ua->request($req);

I assume that the 200 OK goes in the request object, but don't know how to put it there.


Professor

http://www.professorsopportunities.com
Andrew Chang
#4 Posted : Sunday, September 18, 2005 6:40:23 PM
Rank: Starting Member

Groups: Registered

Joined: 1/10/2003
Posts: 738
Location: ,
What a page or script is viewed it produces certain codes listed here

http://www.w3.org/Protoc...2616/rfc2616-sec10.html

if your code has errors in it it may get hit by paypal and run fine up to the error after an error is detected a error code 500 or other will be returned. If any error code is returned paypal will try to post again.

Andrew Chang
Script to sell downloads: http://itemseller.scorpionsystems.net
Web Design & Scripting: http://scorpionsystems.net
Web & Image Hosting includes global SSL: http://scorpionwebhosting.com
Photographer Gallery Software: http://Photo-Seller.com
Become an affiliate and make money http://worldannouncements.com/affiliates http://scorpionwebhosting.com/affiliate
Free Web Traffic: http://www.trafficswarm.com/go.cgi?169137 , http://www.ts25.com/index.jsp?ref=ScorpionSystems
prof611
#5 Posted : Monday, September 19, 2005 2:27:56 PM
Rank: Starting Member

Groups: Registered

Joined: 9/14/2005
Posts: 6
Location: ,
Thanks again, Andrew. I guess I misinterpreted your earlier reply to mean I had to send the 200 OK response myself. That's why I couldn't figure out how to do it -- it's done automatically, and only if my script has no errors.

It appears that the script (the one in my last reply) is now error-free, as I haven't gotten multiple replies in a few days.


Professor

http://www.professorsopportunities.com
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.204 seconds.