]> git.mjollnir.org Git - moodle.git/commitdiff
x_auth_code is required for capture only transactions!
authorethem <ethem>
Thu, 20 Jul 2006 14:48:03 +0000 (14:48 +0000)
committerethem <ethem>
Thu, 20 Jul 2006 14:48:03 +0000 (14:48 +0000)
NOTE: Capture only transactions have not implemented yet!

enrol/authorize/authorizenetlib.php

index 374141251b9bf0cd3b176562785a76973b017b3c..978d7085bfef90f40a435322aa5eb2d499bea928 100644 (file)
@@ -137,10 +137,15 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE)
                 $message = "Order status must be AN_STATUS_NONE(0)!";
                 return false;
             }
-            if (empty($extra)) {
+            elseif (empty($extra)) {
                 $message = "Need extra fields!";
                 return false;
             }
+            elseif (($action == AN_ACTION_CAPTURE_ONLY) and empty($extra->x_auth_code)) {
+                $message = "x_auth_code is required for capture only transactions!";
+                return false;
+            }
+
             $ext = (array)$extra;
             $poststring .= '&x_type=' . (($action==AN_ACTION_AUTH_ONLY)
                                           ? 'AUTH_ONLY' :( ($action==AN_ACTION_CAPTURE_ONLY)