Go to the source code of this file.
Namespaces |
| namespace | enrol |
Functions |
| | message_paypal_error_to_admin ($subject, $data) |
Variables |
| if(empty($_POST) or!empty($_GET)) | $req = 'cmd=_notify-validate' |
| | Keep out casual intruders.
|
| | $data = new stdClass() |
| foreach($_POST as $key=> $value) | $custom = explode('-', $data->custom) |
| $data | userid = (int)$custom[0] |
| $data | courseid = (int)$custom[1] |
| $data | instanceid = (int)$custom[2] |
| $data | payment_gross = $data->mc_gross |
| $data | payment_currency = $data->mc_currency |
| $data | timeupdated = time() |
if(!$user=$DB->get_record("user",
array("id"=> $data->userid)))
if(!$course=$DB->get_record("course",
array("id"=> $data->courseid)))
if(!$context=get_context_instance(CONTEXT_COURSE,
$course->id)) if(!$plugin_instance=$DB->
get_record("enrol", array("id"=>
$data->instanceid,"status"=>0))) | $plugin = enrol_get_plugin('paypal') |
| | get the user and course records
|
| | $header = '' |
| | Open a connection back to PayPal to validate the data.
|
| | $paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com' |
| | $fp = fsockopen ($paypaladdr, 80, $errno, $errstr, 30) |
| | exit |
Function Documentation
Variable Documentation
| $fp = fsockopen ($paypaladdr, 80, $errno, $errstr, 30) |
Open a connection back to PayPal to validate the data.
Definition at line 92 of file ipn.php.
| $paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com' |
get the user and course records
Definition at line 89 of file ipn.php.
| if (empty($_POST) or!empty($_GET)) $req = 'cmd=_notify-validate' |
Keep out casual intruders.
Read all the data from PayPal and get it ready for later; we expect only valid UTF-8 encoding, it is the responsibility of user to set it up properly in PayPal business account, it is documented in docs wiki.
Definition at line 49 of file ipn.php.