NOTICE Notice: This is an old thread. The last post was 2089 days ago. If your post is not directly related to this discussion please consider making a new thread.
Results 1 to 2 of 2

Thread: Important Notice to any VB users using PayPal - Manual File Update Needed ASAP!

  1. #1

    Exclamation Important Notice to any VB users using PayPal - Manual File Update Needed ASAP!

    If you use vBulletin and PayPal to accept subscription payments your payments may stop working October 7th if you don't make manual file edits!

    PayPal announced changes to their system which require a minor change in how vBulletin communicates with their servers. These changes are due to take effect October 7th.

    These changes will be included in VB 3.8.8, 4.2.2, and 5.1.0. However none of these versions are likely to be released in the next couple days (although 3.8.8 and 4.2.2 are available as Betas.)

    If you do not want to upgrade to the Beta versions I have written out the manual file edits on this post on vBulletin.com:

    http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/3999104-paypal-changes-effective-october-1st-manual-file-update-may-be-needed

    Note- These same changes are for all versions, VB 3.x, VB 4.x, and VB 5.x. The only difference with 5.x is that the directory /includes/paymentapi/ is instead /core/includes/paymentapi.

    You must make these changes yourself before October 7th or you risk all future PayPal Payments failing.

    This is a pretty big deal.

    I have made these changes already to both my VB 3.8.7 forum and this one running 4.2.1 and confirmed subscriptions still work with these changes.

    Below is the message PayPal sent out-

    Dear Customer,


    In a bulletin dated October 18, 2011, we announced that we were going to expand the number of IP addresses for www.paypal.com to improve our site’s performance, scalability and availability. As part of this transition, we planned to discontinue support for HTTP 1.0 protocol starting October 7, 2013.


    We have recently identified that this change may impact the ability of some of our merchants to perform IPN (Instant Payment Notification) post-back validation or PDT (Payment Data Transfer) posts to www.paypal.com and ipnpb.paypal.com. This happens when the IPN or PDT scripts use HTTP 1.0 protocol and do not include the “Host: www.paypal.com” or “Host: ipnpb.paypal.com” header in the HTTP request.


    Additional Details


    Starting October 7, 2013, we will require all incoming requests to have a “Host” header which complies with HTTP 1.1 Specifications. This header was not required under HTTP 1.0. IPN and PDT scripts using HTTP 1.0 may start failing with “HTTP/1.0 400 Bad Request” errors after October 7, 2013, which will result in IPN messages not being validated successfully, or PDT scripts not being able to retrieve transaction information.


    Action Required before October 7, 2013


    Merchants need to update their IPN and/or PDT scripts to use HTTP 1.1, and include the “Host” and “Connection: close” HTTP header in the IPN postback script.


    Example with Host as www.paypal.com (please make necessary changes if you are using ipnpb.paypal.com):


    ASP
    //Set values for the request back
    req.Method="POST";
    req.Host="'www.paypal.com'";
    req.ContentType="application/x-www-form-urlencoded";


    Perl
    $req=HTTP::Request->new('POST', 'https://www.paypal.com/cgi-bin/webscr');
    $req->content_type('application/x-www-form-urlencoded');
    $req->header(Host=> 'www.paypal.com');
    $req->header(Connection=> 'close');


    PHP
    // post back to PayPal system to validate
    $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 .="Connection: close\r\n\r\n";


    Java
    HttpsURLConnection uc=(HttpsURLConnection) u.openConnection();
    uc.setDoOutput(true);
    uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    uc.setRequestProperty("Host", "www.paypal.com");
    uc.setRequestProperty("Connection", "Close");


    The PayPal Sandbox has been configured to reject any HTTP requests without the “Host” header with HTTP 400 error. Merchants can use the Sandbox environment to certify the changes to their IPN and PDT scripts.


    For more information on PDT and IPN, please refer to http://www.paypal.com/pdt and http://www.paypal.com/ipn. For additional information or questions about this change, please contact PayPal's Merchant Technical Support team via https://www.paypal.com/mts.


    Sincerely,


    PayPal
    -Joe

  2. #2
    In case vBulletin.com is down for any reason, here are the instructions-

    Hello All, If you use vBulletin 3.x or 4.x (any version below 3.8.8 or 4.2.2) AND you use PayPal you may need to make a manual file edit to you /includes/paymentapi/class_paypal.php file. If you see payments failing make these changes.


    The fix was posted by Paul M in this JIRA- http://tracker.vbulletin.com/browse/VBIV-15747


    I am reposting here for those uncomfortable with JIRA-


    Please do not use Windows Notepad to edit PHP files, it can cause issues by inserting invisible characters. A good free alternative is Notepad2 or Notepad++, both can easily be found and downloaded via a Google search. Or any other code editing text editor you have will work.


    Open and edit the file: /includes/paymentapi/class_paypal.php


    There are two instances of:


    Code:
    $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($query) . "\r\n\r\n";

    Change them both to:


    Code:
    $header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
    $header .= "Host: www.paypal.com\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($query) . "\r\n";
    $header .= "User-Agent: vBulletin via PHP\r\n";
    $header .= "Connection: Close\r\n\r\n";

    NEXT... there are two instances of:


    Code:
                curl_setopt($ch, CURLOPT_URL, 'http://www.paypal.com/cgi-bin/webscr');
                curl_setopt($ch, CURLOPT_TIMEOUT, 15);
                curl_setopt($ch, CURLOPT_POST, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_USERAGENT, 'vBulletin via cURL/PHP');

    below each one add the line:


    Code:
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));

    Then save and re-upload your files. Save an old copy of the old file just in case, but upload the new versions.

    -Joe

Similar Threads

  1. Replies: 0
    Last Post: 09-05-2013, 08:32 PM
  2. An important message about Qapla.com Premium Mods and VB5!
    By BirdOPrey5 in forum News & Announcements
    Replies: 12
    Last Post: 08-25-2012, 11:28 AM
  3. E-mail from this forum update...
    By BirdOPrey5 in forum News & Announcements
    Replies: 0
    Last Post: 09-25-2011, 08:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

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