From 8253de40c6cfd3ac154cf50efe2b0d899140215f Mon Sep 17 00:00:00 2001 From: Mo Farouk <122031508+fmido88@users.noreply.github.com> Date: Thu, 29 Jun 2023 06:30:48 +0300 Subject: [PATCH] fix the logic of refunding --- lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.php b/lib.php index bbedc39e..998da8d4 100644 --- a/lib.php +++ b/lib.php @@ -197,8 +197,8 @@ public function unenrol_user(stdClass $instance, $userid) { $refundperiod = get_config('enrol_wallet', 'unenrolrefundperiod'); $now = time(); if ( - $now < $enrolend - || ($enrolstart - $now) > $refundperiod + $now > $enrolend + || ($now - $enrolstart) > $refundperiod ) { // Condition for refunding aren't met. return parent::unenrol_user($instance, $userid);