Permalink
Browse files

Business checkings can be refunded only for echeck method. Not saving…

… nor checking. Merged from 17stable.
  • Loading branch information...
1 parent d551145 commit 98349513b28e0abf89b77f157f858819e44d01be ethem committed Nov 20, 2006
Showing with 7 additions and 2 deletions.
  1. +7 −2 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) {

0 comments on commit 9834951

Please sign in to comment.