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:
Change them both to:
NEXT... there are two instances of:
below each one add the line:
Then save and re-upload your files. Save an old copy of the old file just in case, but upload the new versions.
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";
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";
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');
Code:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
Comment