Skip to content

Commit

Permalink
MDL-35456 use HTTP 1.1 for PayPal IPN
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Dec 8, 2012
1 parent 9958465 commit df93e51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions enrol/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@
$plugin = enrol_get_plugin('paypal');

/// Open a connection back to PayPal to validate the data
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';
$c = new curl();
$options = array(
'returntransfer' => true,
'httpheader' => array('application/x-www-form-urlencoded'),
'httpheader' => array('application/x-www-form-urlencoded', "Host: $paypaladdr"),
'timeout' => 30,
'CURLOPT_HTTP_VERSION' => CURL_HTTP_VERSION_1_1,
);
$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com';
$location = "https://$paypaladdr/cgi-bin/webscr";
$result = $c->post($location, $req, $options);

Expand Down

0 comments on commit df93e51

Please sign in to comment.