Forums

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

  1. Treytor
    Member
    Posted 1 month 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 1 month ago #

    I am having the same exact problem.

  3. lehacarpenter
    Member
    Posted 1 month ago #

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

  4. atomicat
    Member
    Posted 1 month 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 1 month 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 1 month ago #

    testing

    code
    123456
    foo
    foo
    /code

  7. atomicat
    Member
    Posted 1 month ago #

    testing


    123456
    foo
    foo

  8. atomicat
    Member
    Posted 1 month ago #

    testing
    
    123456
    foo
    foo
  9. atomicat
    Member
    Posted 1 month 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 1 month 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 weeks 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?

Reply

You must log in to post.

About this Topic