]> git.mjollnir.org Git - moodle.git/commitdiff
· Capture_Only transaction added.
authorethem <ethem>
Tue, 13 Jun 2006 07:58:04 +0000 (07:58 +0000)
committerethem <ethem>
Tue, 13 Jun 2006 07:58:04 +0000 (07:58 +0000)
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)

enrol/authorize/authorizenetlib.php
enrol/authorize/const.php

index aeb2e26f4c145c80a6e7ce17211377f53d0b8dc9..e487952c10af8e450519adf460de144ac4592262 100644 (file)
@@ -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:
             {
index 2384fc8a3dcf828f93b89318dddd5ac20b496d8b..3712e1b3484a6fb924b3617d9b6a2f0619265026 100644 (file)
@@ -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);
 /**#@-*/
 
 ?>