aMember 3.2.3 and PayPal's IPN update

Discussion in 'aMember Pro v.3' started by ryanbsmith, Jan 21, 2013.

  1. ryanbsmith

    ryanbsmith Member

    Joined:
    Apr 29, 2008
    Messages:
    31
    I just wanted to confirm that aMember 3.2.3 is configured to work with PayPal's upcoming IPN update. I have not received any notification from PayPal that I need to address anything for my site, but I still want to be assured that there will be no issue, as I rely heavily on recurring PayPal payments.

    Thanks,

    Ryan
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Ryan,
    Yes paypal plugin in 3.2.3 is compatible with upcoming IPN update.
  3. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    What about older versions? At which version did it get fixed, and whats the code to fix earlier versions?

    David
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This fix available from 3.0.6
    For older versions you have to edit /amember/plugins/payment/paypal_r/paypal_r.inc.php find this code:
    PHP:
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " strlen ($req) . "\r\n\r\n";
    and change it to
    PHP:
    $header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Host: www.paypal.com\r\n";
    $header .= "Content-Length: " strlen ($req) . "\r\n\r\n";
  5. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    I was just told by andrey it was needed in 3.1.8, please verify whats needed for which version!
    The fix for 3.1.8 from Andrey:

    //if (extension_loaded('curl') || $config['curl'] ){
    if (false){
    $ret = get_url("https://{$this->paypal_domain}/cgi-bin/webscr", $req);
    } else {
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Host: www.paypal.com\r\n";
    $header .= "Content-Type: application/x-www-form-
    urlencoded\r\n";
    $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n";
    $fp = fsockopen ($this->paypal_domain, 80, $errno, $errstr, 30);



    My 3.1.8 paypal shows this, which was wrong...
    >
    > if (extension_loaded('curl') || $config['curl'] ){
    > $ret = get_url("https://{$this->
    paypal_domain}/cgi-bin/webscr", $req);
    > } else {
    > $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    > $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    > $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n";
    > $fp = fsockopen ($this->paypal_domain, 80, $errno, $errstr, 30);
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    From 3.0.6 curl validation was added to paypal plugin. Almost all hosting companies have curl support by default, (either compiled in php or standalone curl binary which can be configured in amember CP -> Setup -> Global)
    If there is no curl support fix from my message #4 should work.

Share This Page