Support » Plugins » [Plugin: Donate Plus] FATAL ERROR No Reply at all Posted IPN variables in order received:

  • I’m trying to set up donate plus on my site, and am getting this error in my e-mail box when I receive a donation:

    Subject: Donate Plus – Paypal IPN Transaction

    “FATAL ERROR No Reply at all Posted IPN variables in order received:”

    Then it proceeds to list all the variables for the IPN. It seems like the plugin is not properly interfacing with Paypal’s IPN. I have in enabled in my business paypal account, but am unsure what’s going on.

    Because of this error, no credit is given on the donor wall for donations… 🙁

    Does anyone have any ideas? Thanks in advance for your help!

    http://wordpress.org/extend/plugins/donate-plus/

Viewing 15 replies - 1 through 15 (of 21 total)
  • I am having the same exact problem.

    Me too, with a Premiere account. Looking forward to hearing what the problem is…

    Ditto with problems.

    I was able to test to the Belahost.com site and veryfy IPN success with the PP sandbox, but I can’t get the real PP to give back a valid IPN.

    They must have changed something at PP.

    Help!

    I have found out that this problem is because PP has now put up a 301 redirect to https://www.paypal.com/cgi-bin/webscr from the http version.

    Since the script only posts via unencrypted http, it fails because it can’t submit to the redirect, and has no smarts to submit via SSL.

    I’m working on modifications to the paypal.php script that will use libcurl (linux/unix) to post the IPN reply via SSL.

    testing

    code
    123456
    foo
    foo
    /code

    testing


    123456
    foo
    foo

    testing
    
    123456
    foo
    foo

    Sorry about the testing, but I need the code to come through OK.

    Anyway, the problem is solved. You will need to have compiled in curl support when you built PHP. I’m not sure if this will work on Windows or not.

    This solution assumes the following: That you are on a Linux or Unix system, and have access to the GNU version of the patch program.

    First, copy the following into a file called paypal.php.diff in your home directory on the server:

    *** stock/paypal.php	2009-10-23 20:17:17.000000000 -0700
    --- live/paypal.php	2009-10-23 20:17:17.000000000 -0700
    ***************
    *** 35,41 ****
      #the emails will be coming from
      $from_email = $dplus['ty_email'];
    
    -
      # Convert Super globals For backward compatibility
      if(phpversion() <= "4.0.6")  { $_POST = ($HTTP_POST_VARS);  }
    
    --- 35,40 ----
    ***************
    *** 62,72 ****
      ## Verify Mode 1: This will post the IPN variables to the Paypal Network for Validation
                  if     ($verifymode == 1)
                  {
    ! $port = fsockopen ("paypal.com", 80, $errno, $errstr, 30);
    ! $header = "POST /cgi-bin/webscr HTTP/1.0\r\n".
    ! "Host: www.paypal.com\r\n".
    ! "Content-Type: application/x-www-form-urlencoded\r\n".
    ! "Content-Length: " . strlen($postipn) . "\r\n\r\n";
                  }
      ## Verify Mode 2: This will post the IPN variables to Belahost Test Script for validation
      ## Located at www.belahost.com/pp/index.php
    --- 61,80 ----
      ## Verify Mode 1: This will post the IPN variables to the Paypal Network for Validation
                  if     ($verifymode == 1)
                  {
    !
    ! # Old PP code
    ! # $port = fsockopen ("paypal.com", 80, $errno, $errstr, 30);
    ! #$header = "POST /cgi-bin/webscr HTTP/1.0\r\n".
    ! #"Host: www.paypal.com\r\n".
    ! #"Content-Type: application/x-www-form-urlencoded\r\n".
    ! #"Content-Length: " . strlen($postipn) . "\r\n\r\n";
    !
    ! # New PP code
    ! # Still open the port, since there is error checking code around this
    ! # Although you can't actually do anything via 443 without encryption
    ! $port = fsockopen ("www.paypal.com", 443, $errno, $errstr, 30);
    ! $postURL = "https://www.paypal.com/cgi-bin/webscr";
    !
                  }
      ## Verify Mode 2: This will post the IPN variables to Belahost Test Script for validation
      ## Located at www.belahost.com/pp/index.php
    ***************
    *** 105,118 ****
    
      # If No Errors to this point then we proceed with the processing.
      # Open port to paypal or test site and post Varibles.
                  else
               {
    ! 			fputs ($port, $header . $postipn);
    !             while (!feof($port))
    ! 				    {
    !                    $reply = fgets ($port, 1024);
    !                    $reply = trim ($reply);
    !                     }
    
      # Prepare a Debug Report
      $ipnreport = $orgipn . "<br /><b>" . "IPN Reply: " . $reply . "</b>";
    --- 113,136 ----
    
      # If No Errors to this point then we proceed with the processing.
      # Open port to paypal or test site and post Varibles.
    +
    + # New PP code to deal with SSL
                  else
               {
    !             if     ($verifymode == 1)
    !             {
    !                 $reply = httpsPost($postURL, $postipn);
    !             }
    !
    !             else
    !             {
    ! 	        fputs ($port, $header . $postipn);
    !                 while (!feof($port))
    ! 		{
    !                   $reply = fgets ($port, 1024);
    !                   $reply = trim ($reply);
    !                 }
    !             }
    
      # Prepare a Debug Report
      $ipnreport = $orgipn . "<br /><b>" . "IPN Reply: " . $reply . "</b>";
    ***************
    *** 333,336 ****
      *   for you contact http://www.belahost.com/contact.php *
      ********************************************************/
    
    ! ?>
    \ No newline at end of file
    --- 351,377 ----
      *   for you contact http://www.belahost.com/contact.php *
      ********************************************************/
    
    ! # This is the added code for dealing with HTTPS posting to PayPal via curl
    ! # Posting via HTTP is no longer supported
    ! function httpsPost($Url, $strRequest)
    ! {
    !    // Initialization
    !    $ch=curl_init();
    !    // Set parameters
    !    curl_setopt($ch, CURLOPT_URL, $Url);
    !    // Return a variable instead of posting it directly
    !    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    !    // Active the POST method
    !    curl_setopt($ch, CURLOPT_POST, 1) ;
    !    // Request
    !    curl_setopt($ch, CURLOPT_POSTFIELDS, $strRequest);
    !    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    !    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    !    // execute the connection
    !    $result = curl_exec($ch);
    !    // Close it
    !    curl_close($ch);
    !    return $result;
    ! }
    !
    ! ?>

    Next, copy the following into a file called donate-plus.php.diff in your home directory on the server:

    *** stock/donate-plus.php	2009-10-23 20:20:53.000000000 -0700
    --- live/donate-plus.php	2009-10-23 20:20:53.000000000 -0700
    ***************
    *** 345,351 ****
      				$tyurl = $wall.'?thankyou=true';
      			else
      				$tyurl = $wall.'&thankyou=true';
    ! 			$output = '<form id="donateplusform" action="http://www.paypal.com/cgi-bin/webscr" method="post">';
      			//$output = '<form id="donateplusform" action="http://www.belahost.com/pp/" method="post">';
    
    --- 345,352 ----
      				$tyurl = $wall.'?thankyou=true';
      			else
      				$tyurl = $wall.'&thankyou=true';
    !                         $output = '<form id="donateplusform" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
    ! 			//$output = '<form id="donateplusform" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">';
      			//$output = '<form id="donateplusform" action="http://www.belahost.com/pp/" method="post">';
    
    ***************
    *** 559,562 ****
      	global $donateplus;
      	echo $donateplus->DonateTotal();
      }
    ! ?>
    \ No newline at end of file
    --- 560,563 ----
      	global $donateplus;
      	echo $donateplus->DonateTotal();
      }
    ! ?>

    Now, assuming you are on Linux/Unix, and have the GNU version of the patch program (necessary), then cd to (WP install dir)/wp-content/plugins/donate-plus, and run the following commands:

    cp -p paypal.php paypal.php.bak
    cp -p donate-plus.php donate-plus.php.bak
    patch -p1 -i ~/paypal.php.diff paypal.php
    patch -p1 -i ~/donate-plus.php.diff donate-plus.php

    That’s it. You will probably want to verify that the live/testing settings in paypal.php are still what you want, and that the host to POST to in donate-plus.php is set properly as well.

    Sorry about the testing, but I need the code to come through OK.

    Anyway, the problem is solved. You will need to have compiled in curl support when you built PHP. I’m not sure if this will work on Windows or not.

    This solution assumes the following: That you are on a Linux or Unix system, and have access to the GNU version of the patch program.

    First, copy the following into a file called paypal.php.diff in your home directory on the server:

    *** stock/paypal.php	2009-10-23 20:17:17.000000000 -0700
    --- live/paypal.php	2009-10-23 20:17:17.000000000 -0700
    ***************
    *** 35,41 ****
      #the emails will be coming from
      $from_email = $dplus['ty_email'];
    
    -
      # Convert Super globals For backward compatibility
      if(phpversion() <= "4.0.6")  { $_POST = ($HTTP_POST_VARS);  }
    
    --- 35,40 ----
    ***************
    *** 62,72 ****
      ## Verify Mode 1: This will post the IPN variables to the Paypal Network for Validation
                  if     ($verifymode == 1)
                  {
    ! $port = fsockopen ("paypal.com", 80, $errno, $errstr, 30);
    ! $header = "POST /cgi-bin/webscr HTTP/1.0\r\n".
    ! "Host: www.paypal.com\r\n".
    ! "Content-Type: application/x-www-form-urlencoded\r\n".
    ! "Content-Length: " . strlen($postipn) . "\r\n\r\n";
                  }
      ## Verify Mode 2: This will post the IPN variables to Belahost Test Script for validation
      ## Located at www.belahost.com/pp/index.php
    --- 61,80 ----
      ## Verify Mode 1: This will post the IPN variables to the Paypal Network for Validation
                  if     ($verifymode == 1)
                  {
    !
    ! # Old PP code
    ! # $port = fsockopen ("paypal.com", 80, $errno, $errstr, 30);
    ! #$header = "POST /cgi-bin/webscr HTTP/1.0\r\n".
    ! #"Host: www.paypal.com\r\n".
    ! #"Content-Type: application/x-www-form-urlencoded\r\n".
    ! #"Content-Length: " . strlen($postipn) . "\r\n\r\n";
    !
    ! # New PP code
    ! # Still open the port, since there is error checking code around this
    ! # Although you can't actually do anything via 443 without encryption
    ! $port = fsockopen ("www.paypal.com", 443, $errno, $errstr, 30);
    ! $postURL = "https://www.paypal.com/cgi-bin/webscr";
    !
                  }
      ## Verify Mode 2: This will post the IPN variables to Belahost Test Script for validation
      ## Located at www.belahost.com/pp/index.php
    ***************
    *** 105,118 ****
    
      # If No Errors to this point then we proceed with the processing.
      # Open port to paypal or test site and post Varibles.
                  else
               {
    ! 			fputs ($port, $header . $postipn);
    !             while (!feof($port))
    ! 				    {
    !                    $reply = fgets ($port, 1024);
    !                    $reply = trim ($reply);
    !                     }
    
      # Prepare a Debug Report
      $ipnreport = $orgipn . "<br /><b>" . "IPN Reply: " . $reply . "</b>";
    --- 113,136 ----
    
      # If No Errors to this point then we proceed with the processing.
      # Open port to paypal or test site and post Varibles.
    +
    + # New PP code to deal with SSL
                  else
               {
    !             if     ($verifymode == 1)
    !             {
    !                 $reply = httpsPost($postURL, $postipn);
    !             }
    !
    !             else
    !             {
    ! 	        fputs ($port, $header . $postipn);
    !                 while (!feof($port))
    ! 		{
    !                   $reply = fgets ($port, 1024);
    !                   $reply = trim ($reply);
    !                 }
    !             }
    
      # Prepare a Debug Report
      $ipnreport = $orgipn . "<br /><b>" . "IPN Reply: " . $reply . "</b>";
    ***************
    *** 333,336 ****
      *   for you contact http://www.belahost.com/contact.php *
      ********************************************************/
    
    ! ?>
    \ No newline at end of file
    --- 351,377 ----
      *   for you contact http://www.belahost.com/contact.php *
      ********************************************************/
    
    ! # This is the added code for dealing with HTTPS posting to PayPal via curl
    ! # Posting via HTTP is no longer supported
    ! function httpsPost($Url, $strRequest)
    ! {
    !    // Initialization
    !    $ch=curl_init();
    !    // Set parameters
    !    curl_setopt($ch, CURLOPT_URL, $Url);
    !    // Return a variable instead of posting it directly
    !    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    !    // Active the POST method
    !    curl_setopt($ch, CURLOPT_POST, 1) ;
    !    // Request
    !    curl_setopt($ch, CURLOPT_POSTFIELDS, $strRequest);
    !    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    !    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    !    // execute the connection
    !    $result = curl_exec($ch);
    !    // Close it
    !    curl_close($ch);
    !    return $result;
    ! }
    !
    ! ?>

    Next, copy the following into a file called donate-plus.php.diff in your home directory on the server:

    *** stock/donate-plus.php	2009-10-23 20:20:53.000000000 -0700
    --- live/donate-plus.php	2009-10-23 20:20:53.000000000 -0700
    ***************
    *** 345,351 ****
      				$tyurl = $wall.'?thankyou=true';
      			else
      				$tyurl = $wall.'&thankyou=true';
    ! 			$output = '<form id="donateplusform" action="http://www.paypal.com/cgi-bin/webscr" method="post">';
      			//$output = '<form id="donateplusform" action="http://www.belahost.com/pp/" method="post">';
    
    --- 345,352 ----
      				$tyurl = $wall.'?thankyou=true';
      			else
      				$tyurl = $wall.'&thankyou=true';
    !                         $output = '<form id="donateplusform" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
    ! 			//$output = '<form id="donateplusform" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">';
      			//$output = '<form id="donateplusform" action="http://www.belahost.com/pp/" method="post">';
    
    ***************
    *** 559,562 ****
      	global $donateplus;
      	echo $donateplus->DonateTotal();
      }
    ! ?>
    \ No newline at end of file
    --- 560,563 ----
      	global $donateplus;
      	echo $donateplus->DonateTotal();
      }
    ! ?>

    Now, assuming you are on Linux/Unix, and have the GNU version of the patch program (necessary), then cd to (WP install dir)/wp-content/plugins/donate-plus, and run the following commands:

    cp -p paypal.php paypal.php.bak
    cp -p donate-plus.php donate-plus.php.bak
    patch -p1 -i ~/paypal.php.diff paypal.php
    patch -p1 -i ~/donate-plus.php.diff donate-plus.php

    That’s it. You will probably want to verify that the live/testing settings in paypal.php are still what you want, and that the host to POST to in donate-plus.php is set properly as well.

    Atomicat pls…. can you help me with this problem? it is possible to solve with a new version of the plugin, or with a modified paypal.php file?

    I fixed it. Paypal is using SSL now. I changed this line in paypal.php

    ## Verify Mode 1: This will post the IPN variables to the Paypal Network for Validation
                if     ($verifymode == 1)
                {
    $port = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

    I forgot what the original code is suppose to be. But searching “Verify Mode 1” should help. And just replace the $port line.

    I can confirm that simply changing the $port line and nothing else, as icybergie suggests completely fixes this problem.

    after changing the port line, it works better, but not completely for me. I get the following message in my email regarding the IPN transaction:

    Your Paypal System failed due to 0 and string php_network_getaddresses: getaddrinfo failed: Name or service not known

    Anybody else had any luck getting this to work?

    The error is common, but I still receive money in my PayPal account. Since that does happen successfully, I don’t really care about the error I see in my email. If the money wasn’t appearing, then I would be drastically searching for an answer. But it’s not the case.

    The error indicates the data in the instant payment notification (IPN) was unable to be saved in the database by the plugin. Which in turn prevents the donation total tracking from working properly. But yes, the donation still goes through at paypal just fine.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘[Plugin: Donate Plus] FATAL ERROR No Reply at all Posted IPN variables in order received:’ is closed to new replies.