kirkh34 Posted December 13, 2010 Share Posted December 13, 2010 I'm trying to set up paypal payment processing on my website. I have godaddy shared hosting (<--mistake) and I'm trying my hardest to not switch hosts. The payments process fine, it is the listener that I'm having problems with. Paypal POSTs data to a script for which you set the url to a "listener" script in your settings. When a payment is made.... they POST the data to the listener script... you encode the data...append it all together plus another variable and send it back to be verified that it matches... Well I'm not too worried about the script working and all that... the problem is I'm not even RECEIVING the post. I have a simple foreach loop gather and append the data into a string. I have it set up right now to insert into MYSQL just so I can SEE if it's working....You can check your IPN history and I can see that payments are made but paypal is sending it over and over it's in a "retrying" state with a 408 error. My server is not sending a 200ok response. After 4 days of bashing my head against the wall I figured out that there's a problem with godaddy shared hosting.. If I use a virtual private server with the SAME script from godaddy it works just fine. But on the shared hosting it blocks it for some reason...After calling paypal and godaddy countless times with them pointing their finger at each other... one godaddy support rep tells me that I should set my script up with a proxy and he gave me info which I will show you in the script... This is what I need help with right. How can I receive POST data through a proxy in my script.... I want to add that this doesn't make sense to me because in my script I also have the word "yes" insert into MYSQL even if the script is hit at all... All this time my script is NEVER even touched by paypal... So.. if I add this proxy stuff... how will let my script even be accessed? I'm not sure how servers work together too well to process things. It just didn't seem like the proxy thing would even help when my script can't even be accessed it seems. Any help is appreciated. Here's the simple code I'm working with: $con = mysql_connect("","","") or die(mysql_error()); $db = mysql_select_db("swellshirt",$con); $ip = "64.202.165.130"; // proxy IP <-- IP... $port = 3128; // proxy port $url_proxy = 'http://proxy.shr.secureserver.net'; // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } mysql_query("INSERT INTO orders (description, street) VALUES ('$req', 'yes') ") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/221531-receiving-post-data-through-proxy-paypal-ipn-listener/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2010 Share Posted December 13, 2010 Can YOU browse to the listener script, on the shared hosting, using the EXACT URL (protocol, subdomain/host name, domain, path, and document name) that you have entered in the Paypal IPN settings and get the script to execute? Any chance in your submission to paypal that you are overriding the listener URL with a url that does not exist? Quote Link to comment https://forums.phpfreaks.com/topic/221531-receiving-post-data-through-proxy-paypal-ipn-listener/#findComment-1146755 Share on other sites More sharing options...
kirkh34 Posted December 13, 2010 Author Share Posted December 13, 2010 yes... the url I enter is http://www.swellshirt.com/ipn.php This is the URL I give that if I upload to the vps...it works but on the shared it doesn't... but if I go to that it parses and in my database "yes" gets inserted along with that single variable. No I'm positive they are getting the correct URL because in the instant payment notification history (where you see the details w/ the 408 error) it shows the URL I specified and it's right on. EDIT: What do mean by protocol and subdomain/host name? Are you talking about the absolute path with the IP address of my server? If so, no I can't. Quote Link to comment https://forums.phpfreaks.com/topic/221531-receiving-post-data-through-proxy-paypal-ipn-listener/#findComment-1146758 Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2010 Share Posted December 13, 2010 http is the protocol. www is the hostname/sub-domain. Perhaps if you were using https and/or the URL without the www on it? So did you actually try browsing to the URL on the shared web host so that you know that the URL is pointing to the correct server? Quote Link to comment https://forums.phpfreaks.com/topic/221531-receiving-post-data-through-proxy-paypal-ipn-listener/#findComment-1146768 Share on other sites More sharing options...
kirkh34 Posted December 13, 2010 Author Share Posted December 13, 2010 Yes I tried all of the above plus changing the filename... I've been stuck on this for 4 days and probably tried everything possible.. If you see this thread and read the last post...https://www.x.com/message/121905?tstart=0 ... he is having the same problem I have and realized that it's not working on shared hosting. But I don't have a VPS. I don't believe there is a problem with the script or their servers or the settings of the IPN... it's the godaddy shared hosting that is not allowing it for some reason. Quote Link to comment https://forums.phpfreaks.com/topic/221531-receiving-post-data-through-proxy-paypal-ipn-listener/#findComment-1146774 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.