]> git.mjollnir.org Git - moodle.git/commitdiff
merged from 16stable
authorethem <ethem>
Tue, 29 Aug 2006 09:04:03 +0000 (09:04 +0000)
committerethem <ethem>
Tue, 29 Aug 2006 09:04:03 +0000 (09:04 +0000)
enrol/authorize/authorizenetlib.php

index fa9e55ae41f55399029c6957179b6e0f41ce9cbe..6b4869766e676db660686a546de116723f7aa0b6 100644 (file)
@@ -297,7 +297,7 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE)
                 $order->transid = $transid;
                 if ($action == AN_ACTION_AUTH_ONLY) {
                     $order->status = AN_STATUS_AUTH;
-                    // dont't update settletime
+                    // don't update order->settletime
                 } else {
                     $order->status = AN_STATUS_AUTHCAPTURE;
                     $order->settletime = authorize_getsettletime(time());
@@ -324,12 +324,9 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE)
             }
             case AN_ACTION_VOID:
             {
-                $tableupdate = 'enrol_authorize';
-                if ($order->status == AN_STATUS_CREDIT) {
-                    $tableupdate = 'enrol_authorize_refunds';
-                }
-                // dont't update settletime
+                $tableupdate = ($order->status == AN_STATUS_CREDIT) ? 'enrol_authorize_refunds' : 'enrol_authorize';
                 $order->status = AN_STATUS_VOID;
+                // don't update order->settletime
                 if (! update_record($tableupdate, $order)) {
                     enrolment_plugin_authorize::email_to_admin("Error while trying to update data " .
                     "in table $tableupdate. Please edit manually this record: ID=$order->id.", $order);