From e758a8f627b1918405409aa638222bb7c4cb3e0c Mon Sep 17 00:00:00 2001 From: ethem Date: Tue, 13 Jun 2006 07:58:04 +0000 Subject: [PATCH] =?utf8?q?=B7=20Capture=5FOnly=20transaction=20added.=20Ca?= =?utf8?q?pture=5FOnly=20transactions=20are=20used=20when=20you=20already?= =?utf8?q?=20have=20an=20authorization=20from=20a=20bank.=20To=20use=20thi?= =?utf8?q?s=20type=20of=20transaction,=20you=20will=20need=20an=20authoriz?= =?utf8?q?ation=20code=20from=20the=20card-issuer=20(usually=20a=205=20or?= =?utf8?q?=206=20digit=20number).=20For=20example,=20if=20you=20called=20V?= =?utf8?q?isa=20directly=20and=20obtained=20an=20authorization=20over=20th?= =?utf8?q?e=20phone,=20you=20would=20need=20to=20submit=20a=20Capture=5FOn?= =?utf8?q?ly=20transaction=20to=20start=20the=20funds=20transfer=20process?= =?utf8?q?.=20You=20can=20manually=20submit=20a=20Capture=5FOnly=20transac?= =?utf8?q?tion=20from=20your=20Virtual=20Terminal=20by=20selecting=20Captu?= =?utf8?q?re=20Only,=20or=20from=20a=20website=20or=20billing=20applicatio?= =?utf8?q?n=20by=20including=20the=20following=20variables=20with=20your?= =?utf8?q?=20transaction=20request:?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit · x_Type (Capture_Only) · x_Auth_Code (the 5 or 6 digit code provided by the card-issuer) --- enrol/authorize/authorizenetlib.php | 7 +++++-- enrol/authorize/const.php | 14 ++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) 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); /**#@-*/ ?> -- 2.39.5