Forums

[Plugin: Donate Plus] FATAL ERROR No Reply at all Posted IPN variables in order received: (22 posts)

  1. Treytor
    Member
    Posted 2 years ago #

    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/

  2. uk_ca_usa
    Member
    Posted 2 years ago #

    I am having the same exact problem.

  3. lehacarpenter
    Member
    Posted 2 years ago #

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

  4. atomicat
    Member
    Posted 2 years ago #

    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!

  5. atomicat
    Member
    Posted 2 years ago #

    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.

  6. atomicat
    Member
    Posted 2 years ago #

    testing

    code
    123456
    foo
    foo
    /code

  7. atomicat
    Member
    Posted 2 years ago #

    testing


    123456
    foo
    foo

  8. atomicat
    Member
    Posted 2 years ago #

    testing
    
    123456
    foo
    foo
  9. atomicat
    Member
    Posted 2 years ago #

    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: http://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 http://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: http://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 http://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.

  10. atomicat
    Member
    Posted 2 years ago #

    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: http://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 http://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: http://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 http://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.

  11. ginmax
    Member
    Posted 2 years ago #

    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?

  12. icybergie
    Member
    Posted 2 years ago #

    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.

  13. JpMaxMan
    Member
    Posted 2 years ago #

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

  14. raceforothers
    Member
    Posted 1 year ago #

    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?

  15. pclove
    Member
    Posted 1 year ago #

    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.

  16. raceforothers
    Member
    Posted 1 year ago #

    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.

  17. Dave
    Member
    Posted 1 year ago #

    Then - how can we get the database to save the donation correctly? We'd quite like to show our other website users how much we've raised so far. Without this, they also don't seem to get our thank you email.

    http://www.sid-international.co.uk

  18. callmehippy
    Member
    Posted 1 year ago #

    worked perfectly for me! many thanks.

  19. mercuryjones
    Member
    Posted 1 year ago #

    Just a follow up on this:
    I was wondering why the IPN would not work on Port 80. It is supposed to work on any port, in fact PayPal apparently defaults to Port 80. However, PayPal does recommend using port 443 because there are more listeners on 443. The IPN procedure in Paypal expects to receive your response within 30 seconds, hence if your script is unable to connect to a listener on port 80 within that time, you will not get a response.

  20. Theme7.net
    Member
    Posted 1 year ago #

    I have suffered the same issue.
    Changing the port line didn't work for me :(
    ($port = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);)

    The payments go through and can get a success message on return to the site from paypal but alas, no comments or total.

    I have looked around for another plugin but this one is perfect.

    Halp!

    http://www.stroke4stroke.com.au

  21. stevechippy
    Member
    Posted 1 year ago #

    I fixed mine - it's been months since i've had time to look at it.

    I changed my paypal.php file slightly (only a few lines) and you can download the new version at:
    http://www.umpcportal.com/wp-content/plugins/donate-plus/paypal.php.txt

    Basically I took out a trim of the returned result (trim is not used in papyal code examples) and switched to SSL.

    I also enabled IPN tracking at Paypal in accordance with the instructions...

    http://www.umpcportal.com/wp-content/plugins/donate-plus/paypal.php
    This is your IPN Notification URL. If you have issues with your site receiving your PayPal payments, be sure to manually set this URL in your PayPal Profile IPN settings. You can also view your IPN History on PayPal

    ...but I don't think this makes any difference as it's for a different type of process.

    Hope it helps.

    Steve.

  22. kentopolis
    Member
    Posted 1 year ago #

    Steve, I tried your file, but I just got this error when I tested it:

    Your Paypal System failed due to 0 and string Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

    Anybody have any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic