Jump to content

Receiving POST data through proxy (paypal IPN listener)


kirkh34

Recommended Posts

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());

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.