From: ethem Date: Thu, 20 Jul 2006 14:48:03 +0000 (+0000) Subject: x_auth_code is required for capture only transactions! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=769b3187c2b9ae30de03d3211d22e84e9dad6776;p=moodle.git x_auth_code is required for capture only transactions! NOTE: Capture only transactions have not implemented yet! --- diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index 374141251b..978d7085bf 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -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)