Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

enrol_authorize_refunds must be updated, not enrol_authorize.

  • Loading branch information...
commit 4014910e2930bff067529d5ea238ab2b0317ecb9 1 parent dfb9c29
authored January 02, 2006

Showing 1 changed file with 19 additions and 19 deletions. Show diff stats Hide diff stats

  1. 38  enrol/authorize/index.php
38  enrol/authorize/index.php
@@ -22,16 +22,16 @@
22 22
 $csv = optional_param('csv', '', PARAM_ALPHA);
23 23
 $orderid = optional_param('order', 0, PARAM_INT);
24 24
 
25  
-$strs = get_strings(array('user', 'status', 'action', 'delete', 'time',
26  
-                   'course', 'confirm', 'yes', 'no', 'none', 'error'));
  25
+$strs = get_strings(array('user','status','action','delete','time','course','confirm','yes','no','none','error'));
  26
+$authstrs = get_strings(array('paymentmanagement','orderid','void','capture','refund',
  27
+                              'authorizedpendingcapture','capturedpendingsettle','capturedsettled',
  28
+                              'settled','refunded','cancelled','expired','tested',
  29
+                              'transid','settlementdate','notsettled','amount',
  30
+                              'howmuch','captureyes','unenrolstudent'), 'enrol_authorize');
27 31
 
28  
-$authstrs = get_strings(array('paymentmanagement', 'orderid', 'void', 'capture', 'refund',
29  
-                      'authorizedpendingcapture','capturedpendingsettle', 'capturedsettled',
30  
-                      'settled', 'refunded', 'cancelled', 'expired', 'tested',
31  
-                      'transid', 'settlementdate', 'notsettled', 'amount',
32  
-                      'howmuch', 'captureyes', 'unenrolstudent'), 'enrol_authorize');
33  
-
34  
-print_header("$site->shortname: $authstr->paymentmanagement", "$site->fullname", "<a href=\"index.php\">$authstr->paymentmanagement</a>", "");
  32
+print_header("$site->shortname: $authstr->paymentmanagement",
  33
+             "$site->fullname",
  34
+             "<a href=\"index.php\">$authstr->paymentmanagement</a>", "");
35 35
 
36 36
 if (!empty($csv)) {
37 37
     authorize_csv();
@@ -142,12 +142,12 @@ function authorize_order_details($orderno) {
142 142
     }
143 143
 
144 144
     echo "<form action='index.php' method='post'>\n";
145  
-    echo "<input type='hidden' name='order' value='$order->id'>\n";
  145
+    echo "<input type='hidden' name='order' value='$orderno'>\n";
146 146
 
147 147
     $settled = settled($order);
148 148
     $status = get_order_status_desc($order);
149 149
 
150  
-    $table->data[] = array("<b>$authstrs->orderid:</b>", $order->id);
  150
+    $table->data[] = array("<b>$authstrs->orderid:</b>", $orderno);
151 151
     $table->data[] = array("<b>$authstrs->transid:</b>", $order->transid);
152 152
     $table->data[] = array("<b>$authstrs->amount:</b>", "$order->currency $order->amount");
153 153
     if ((empty($cmdcapture) and empty($cmdrefund) and empty($cmdvoid))) {
@@ -188,7 +188,7 @@ function authorize_order_details($orderno) {
188 188
                         email_to_user($user, $teacher,
189 189
                                       get_string("enrolmentnew", '', $order->shortname),
190 190
                                       get_string('welcometocoursetext', '', $a));
191  
-                        redirect("index.php?order=$order->id");
  191
+                        redirect("index.php?order=$orderno");
192 192
                     }
193 193
                     else {
194 194
                          $table->data[] = array("<b><font color=red>$strs->error:</font></b>",
@@ -205,10 +205,10 @@ function authorize_order_details($orderno) {
205 205
     elseif (!empty($cmdrefund)) { // REFUND
206 206
         $extra = new stdClass();
207 207
         $extra->sum = 0.0;
208  
-        $extra->orderid = $order->id;
  208
+        $extra->orderid = $orderno;
209 209
 
210 210
         $sql = "SELECT SUM(amount) AS refunded FROM {$CFG->prefix}enrol_authorize_refunds " .
211  
-               "WHERE (orderid = '" . $order->id . "') AND (status = '" . AN_STATUS_CREDIT . "')";
  211
+               "WHERE (orderid = '" . $orderno . "') AND (status = '" . AN_STATUS_CREDIT . "')";
212 212
 
213 213
         if ($refund = get_record_sql($sql)) {
214 214
             $extra->sum = doubleval($refund->refunded);
@@ -242,7 +242,7 @@ function authorize_order_details($orderno) {
242 242
                         if (!empty($unenrol)) {
243 243
                             unenrol_student($order->userid, $order->courseid);
244 244
                         }
245  
-                        redirect("index.php?order=$order->id");
  245
+                        redirect("index.php?order=$orderno");
246 246
                     }
247 247
                     else {
248 248
                         $table->data[] = array(get_string('testmode', 'enrol_authorize'), get_string('credittestwarn', 'enrol_authorize'));
@@ -273,7 +273,7 @@ function authorize_order_details($orderno) {
273 273
                 update_record("enrol_authorize", $order); // May be expired.
274 274
                 if ($success) {
275 275
                     if (empty($CFG->an_test)) {
276  
-                        redirect("index.php?order=$order->id");
  276
+                        redirect("index.php?order=$orderno");
277 277
                     }
278 278
                     else {
279 279
                        $table->data[] = array(get_string('testmode', 'enrol_authorize'), get_string('voidtestwarn', 'enrol_authorize'));
@@ -309,13 +309,13 @@ function authorize_order_details($orderno) {
309 309
                     $message = '';
310 310
                     $extra = NULL;
311 311
                     $success = authorizenet_action($suborder, $message, $extra, AN_ACTION_VOID);
312  
-                    update_record("enrol_authorize", $suborder); // May be expired.
  312
+                    update_record("enrol_authorize_refunds", $suborder); // May be expired.
313 313
                     if ($success) {
314 314
                         if (empty($CFG->an_test)) {
315 315
                             if (!empty($unenrol)) {
316 316
                                 unenrol_student($order->userid, $order->courseid);
317 317
                             }
318  
-                            redirect("index.php?order=$order->id");
  318
+                            redirect("index.php?order=$orderno");
319 319
                         }
320 320
                         else {
321 321
                             $table->data[] = array(get_string('testmode', 'enrol_authorize'), get_string('voidtestwarn', 'enrol_authorize'));
@@ -331,7 +331,7 @@ function authorize_order_details($orderno) {
331 331
     }
332 332
     elseif (!empty($cmddelete)) { // DELETE
333 333
         if (!in_array(ORDER_DELETE, $status->actions)) {
334  
-            error("Order $order->id cannot be deleted. Status must be expired.");
  334
+            error("Order $orderno cannot be deleted. Status must be expired.");
335 335
         }
336 336
         if (empty($cmdconfirm)) {
337 337
             $table->data[] = array('<b>Delete?: </b>',

0 notes on commit 4014910

Please sign in to comment.
Something went wrong with that request. Please try again.