@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | require("../../../config.php"); |
33 | 33 | require_once($CFG->libdir.'/eventslib.php'); |
34 | -require_once($CFG->libdir . '/filelib.php'); |
|
34 | +require_once($CFG->libdir.'/filelib.php'); |
|
35 | 35 | |
36 | 36 | // PayPal does not like when we return error messages here, |
37 | 37 | // the custom handler just logs exceptions and stops. |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | $custom = optional_param('custom', '', PARAM_TEXT); |
77 | 77 | $custom = explode('-', $custom); |
78 | 78 | $data->userid = (int)$custom[0]; |
79 | -$data->contextid = (int)$custom[1]; |
|
79 | +$data->contextid = (int)$custom[1]; |
|
80 | 80 | $data->timeupdated = time(); |
81 | 81 | |
82 | -if (! $user = $DB->get_record("user", array("id" => $data->userid))) { |
|
82 | +if (!$user = $DB->get_record("user", array("id" => $data->userid))) { |
|
83 | 83 | paypal_message_error_to_admin("Not a valid user id", $data); |
84 | 84 | die; |
85 | 85 | } |
86 | 86 | |
87 | -if (! $context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
87 | +if (!$context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
88 | 88 | paypal_message_error_to_admin("Not a valid context id", $data); |
89 | 89 | die; |
90 | 90 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | |
168 | 168 | // If our status is not completed or not pending on an echeck clearance then ignore and die. |
169 | 169 | // This check is redundant at present but may be useful if paypal extend the return codes in the future. |
170 | - if (! ( $data->payment_status == "Completed" or |
|
171 | - ($data->payment_status == "Pending" and $data->pending_reason == "echeck") ) ) { |
|
170 | + if (!($data->payment_status == "Completed" or |
|
171 | + ($data->payment_status == "Pending" and $data->pending_reason == "echeck"))) { |
|
172 | 172 | die; |
173 | 173 | } |
174 | 174 | |
@@ -202,10 +202,10 @@ discard block |
||
202 | 202 | $coursecontext = context_course::instance($course->id, IGNORE_MISSING); |
203 | 203 | |
204 | 204 | // Check that amount paid is the correct amount. |
205 | - if ( (float) $paypal->cost < 0 ) { |
|
206 | - $cost = (float) 0; |
|
205 | + if ((float)$paypal->cost < 0) { |
|
206 | + $cost = (float)0; |
|
207 | 207 | } else { |
208 | - $cost = (float) $paypal->cost; |
|
208 | + $cost = (float)$paypal->cost; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // Use the same rounding of floats as on the plugin form. |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | */ |
290 | 290 | |
291 | - } else if (strcmp ($result, "INVALID") == 0) { // ERROR. |
|
291 | + } else if (strcmp($result, "INVALID") == 0) { // ERROR. |
|
292 | 292 | $DB->insert_record("paypal_transactions", $data, false); |
293 | 293 | paypal_message_error_to_admin("Received an invalid payment notification!! (Fake payment?)", $data); |
294 | 294 | } |