From: ethem Date: Tue, 13 Jun 2006 07:58:04 +0000 (+0000) Subject: · Capture_Only transaction added. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e758a8f627b1918405409aa638222bb7c4cb3e0c;p=moodle.git · Capture_Only transaction added. Capture_Only transactions are used when you already have an authorization from a bank. To use this type of transaction, you will need an authorization code from the card-issuer (usually a 5 or 6 digit number). For example, if you called Visa directly and obtained an authorization over the phone, you would need to submit a Capture_Only transaction to start the funds transfer process. You can manually submit a Capture_Only transaction from your Virtual Terminal by selecting Capture Only, or from a website or billing application by including the following variables with your transaction request: · x_Type (Capture_Only) · x_Auth_Code (the 5 or 6 digit code provided by the card-issuer) --- diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index aeb2e26f4c..e487952c10 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -100,6 +100,7 @@ function authorizenet_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE switch ($action) { case AN_ACTION_AUTH_ONLY: + case AN_ACTION_CAPTURE_ONLY: case AN_ACTION_AUTH_CAPTURE: { if ($order->status != AN_STATUS_NONE) { @@ -111,8 +112,9 @@ function authorizenet_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE return false; } $ext = (array)$extra; - $poststring .= '&x_type=' . ($action==AN_ACTION_AUTH_ONLY ? - 'AUTH_ONLY' : 'AUTH_CAPTURE'); + $poststring .= '&x_type=' . (($action==AN_ACTION_AUTH_ONLY) + ? 'AUTH_ONLY' :( ($action==AN_ACTION_CAPTURE_ONLY) + ? 'CAPTURE_ONLY' : 'AUTH_CAPTURE')); foreach($ext as $k => $v) { $poststring .= '&' . $k . '=' . urlencode($v); } @@ -253,6 +255,7 @@ function authorizenet_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE } switch ($action) { case AN_ACTION_AUTH_ONLY: + case AN_ACTION_CAPTURE_ONLY: case AN_ACTION_AUTH_CAPTURE: case AN_ACTION_PRIOR_AUTH_CAPTURE: { diff --git a/enrol/authorize/const.php b/enrol/authorize/const.php index 2384fc8a3d..3712e1b348 100644 --- a/enrol/authorize/const.php +++ b/enrol/authorize/const.php @@ -27,6 +27,7 @@ define('AN_STATUS_TEST', 0x80); * * NONE: No action. Function always returns false. * AUTH_ONLY: Used to authorize only, don't capture. + * CAPTURE_ONLY: Authorization code received from a bank over the phone and capture now. * PRIOR_AUTH_CAPTURE: Used to capture, it was authorized before. * AUTH_CAPTURE: Used to authorize and capture. * CREDIT: Used to return funds to a customer's credit card. @@ -46,12 +47,13 @@ define('AN_STATUS_TEST', 0x80); * 3. These transactions can be voided: * authorized/pending capture, captured/pending settlement, credited/pending settlement */ -define('AN_ACTION_NONE', 0x00); -define('AN_ACTION_AUTH_ONLY', 0x01); -define('AN_ACTION_PRIOR_AUTH_CAPTURE', 0x02); -define('AN_ACTION_AUTH_CAPTURE', 0x03); -define('AN_ACTION_CREDIT', 0x04); -define('AN_ACTION_VOID', 0x08); +define('AN_ACTION_NONE', 0); +define('AN_ACTION_AUTH_ONLY', 1); +define('AN_ACTION_CAPTURE_ONLY', 2); +define('AN_ACTION_AUTH_CAPTURE', 3); +define('AN_ACTION_PRIOR_AUTH_CAPTURE', 4); +define('AN_ACTION_CREDIT', 5); +define('AN_ACTION_VOID', 6); /**#@-*/ ?>