tribulant

PayPal HTTP 1.1 Update for IPN/PDT

Sep 25th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // File: wp-checkout/wp-checkout.php
  2. // Line: Approximately line #2848
  3. // Changes: 2 small changes as noted below
  4.  
  5. $header = "";
  6. $header .= "POST /cgi-bin/webscr HTTP/1.1" . "\r\n";
  7. $header .= "Content-Type: application/x-www-form-urlencoded" . "\r\n";
  8. $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
  9. $ppurl = ($this -> get_option('pp_sandbox') == "Y") ? 'www.sandbox.paypal.com' : 'www.paypal.com';
  10. $fp = fsockopen($ppurl, 80, $errno, $errstr, 30);
  11.  
  12. //.....several lines of code here
  13.  
  14. if (!$fp) {
  15.     $message = __('An HTTP error has occurred', $this -> plugin_name);
  16. } else {
  17.     fputs($fp, $header . $req);
  18.  
  19.     while (!feof($fp)) {
  20.         $res = null;
  21.         $res = trim(fgets($fp, 1024));
Add Comment
Please, Sign In to add comment