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 15b3a43 commit 61cbbeb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions enrol/paypal/ipn.php
Expand Up @@ -90,13 +90,14 @@
$plugin = enrol_get_plugin('paypal'); $plugin = enrol_get_plugin('paypal');


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


Expand Down

0 comments on commit 61cbbeb

Please sign in to comment.