Merge branch 'w49_MDL-35456_m25_paypal' of git://github.com/skodak/moodle

This commit is contained in:
Dan Poltawski 2012-12-10 12:03:03 +08:00
commit 9c714c83b7

View File

@ -90,13 +90,14 @@ if (! $plugin_instance = $DB->get_record("enrol", array("id"=>$data->instanceid,
$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);