@@ -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. |
@@ -75,15 +75,15 @@ discard block |
||
75 | 75 | $custom = optional_param('custom', '', PARAM_TEXT); |
76 | 76 | $custom = explode('-', $custom); |
77 | 77 | $data->userid = (int)$custom[0]; |
78 | -$data->contextid = (int)$custom[1]; |
|
78 | +$data->contextid = (int)$custom[1]; |
|
79 | 79 | $data->timeupdated = time(); |
80 | 80 | |
81 | -if (! $user = $DB->get_record("user", array("id" => $data->userid))) { |
|
81 | +if (!$user = $DB->get_record("user", array("id" => $data->userid))) { |
|
82 | 82 | availability_paypal_message_error_to_admin("Not a valid user id", $data); |
83 | 83 | die; |
84 | 84 | } |
85 | 85 | |
86 | -if (! $context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
86 | +if (!$context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
87 | 87 | availability_paypal_message_error_to_admin("Not a valid context id", $data); |
88 | 88 | die; |
89 | 89 | } |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | |
167 | 167 | // If our status is not completed or not pending on an echeck clearance then ignore and die. |
168 | 168 | // This check is redundant at present but may be useful if paypal extend the return codes in the future. |
169 | - if (! ( $data->payment_status == "Completed" or |
|
170 | - ($data->payment_status == "Pending" and $data->pending_reason == "echeck") ) ) { |
|
169 | + if (!($data->payment_status == "Completed" or |
|
170 | + ($data->payment_status == "Pending" and $data->pending_reason == "echeck"))) { |
|
171 | 171 | die; |
172 | 172 | } |
173 | 173 | |
@@ -201,10 +201,10 @@ discard block |
||
201 | 201 | $coursecontext = context_course::instance($course->id, IGNORE_MISSING); |
202 | 202 | |
203 | 203 | // Check that amount paid is the correct amount. |
204 | - if ( (float) $paypal->cost < 0 ) { |
|
205 | - $cost = (float) 0; |
|
204 | + if ((float)$paypal->cost < 0) { |
|
205 | + $cost = (float)0; |
|
206 | 206 | } else { |
207 | - $cost = (float) $paypal->cost; |
|
207 | + $cost = (float)$paypal->cost; |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | // Use the same rounding of floats as on the plugin form. |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | */ |
289 | 289 | |
290 | - } else if (strcmp ($result, "INVALID") == 0) { // ERROR. |
|
290 | + } else if (strcmp($result, "INVALID") == 0) { // ERROR. |
|
291 | 291 | $DB->insert_record("availability_paypal_tnx", $data, false); |
292 | 292 | availability_paypal_message_error_to_admin("Received an invalid payment notification!! (Fake payment?)", $data); |
293 | 293 | } |
@@ -27,5 +27,5 @@ |
||
27 | 27 | $plugin->version = 2018121901; |
28 | 28 | $plugin->requires = 2015050500; |
29 | 29 | $plugin->release = 6; |
30 | -$plugin->maturity = MATURITY_STABLE; |
|
30 | +$plugin->maturity = MATURITY_STABLE; |
|
31 | 31 | $plugin->component = 'availability_paypal'; |