From 98349513b28e0abf89b77f157f858819e44d01be Mon Sep 17 00:00:00 2001 From: ethem Date: Mon, 20 Nov 2006 08:11:21 +0000 Subject: [PATCH] Business checkings can be refunded only for echeck method. Not saving nor checking. Merged from 17stable. --- enrol/authorize/authorizenetlib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index 5b4f268b3c..48d586a5ec 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -133,8 +133,8 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ $action = intval($action); if ($method == AN_METHOD_ECHECK) { - if ($action != AN_ACTION_AUTH_CAPTURE /*&& $action != AN_ACTION_CREDIT*/) { - $message = "Please perform only AUTH_CAPTURE for echecks"; + if ($action != AN_ACTION_AUTH_CAPTURE && $action != AN_ACTION_CREDIT) { + $message = "Please perform AUTH_CAPTURE or CREDIT for echecks"; return AN_RETURNZERO; } } @@ -224,6 +224,10 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ if ($method == AN_METHOD_CC) { $poststring .= '&x_card_num=' . sprintf("%04d", intval($order->refundinfo)); } + elseif ($method == AN_METHOD_ECHECK && empty($order->refundinfo)) { + $message = "Business checkings can be refunded only."; + return AN_RETURNZERO; + } break; } @@ -248,6 +252,7 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ $referer = "Referer: $CFG->an_referer\r\n"; } + $errno = 0; $errstr = ''; $host = $test ? 'certification.authorize.net' : 'secure.authorize.net'; $fp = fsockopen("ssl://$host", 443, $errno, $errstr, 60); if (!$fp) { -- 2.39.5