Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2009
    Location
    Indianapolis
    Posts
    31
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Receiving POST data through proxy (paypal IPN listener)

    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 is the code I'm working with:

    PHP Code:
    $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()); 

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Is this IPN you're doing? If so, you may want to try out the Paypal sandbox. There is an IPN simulator in there that helps a lot when troubleshooting IPN.

    https://developer.paypal.com/

    Create an account and once you're logged in you'll see "test tools" on the left.

  • #3
    New Coder
    Join Date
    Dec 2009
    Location
    Indianapolis
    Posts
    31
    Thanks
    6
    Thanked 0 Times in 0 Posts
    yes I've used that and I got an error everytime... but I solved the problem... It's godaddys' shared hosting.. No one can use an IPN listener and have data POSTed to their server with their shared hosting. It just won't work. For some reason they block. I have moved hosts and everything is fine now. Godaddy shared hosting is cheap but has it's limits.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •