From 0fae43aa7bc3beb9196bd695b79bb3b3c1cd38f0 Mon Sep 17 00:00:00 2001 From: ethem Date: Fri, 1 Sep 2006 15:05:36 +0000 Subject: [PATCH] + Don't show AVS message if not applicable. + Email message that translated instead of english if cc type and payment method will be autoconfigured. --- enrol/authorize/authorizenetlib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/enrol/authorize/authorizenetlib.php b/enrol/authorize/authorizenetlib.php index 272178a004..aeee50a5e7 100644 --- a/enrol/authorize/authorizenetlib.php +++ b/enrol/authorize/authorizenetlib.php @@ -376,7 +376,7 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ if ($message == '[[' . $reasonstr . ']]') { $message = isset($response[3]) ? $response[3] : 'unknown error'; } - if ($method == AN_METHOD_CC and !empty($CFG->an_avs)) { + if ($method == AN_METHOD_CC && !empty($CFG->an_avs) && $response[5] != "P") { $avs = "avs" . strtolower($response[5]); $stravs = get_string($avs, "enrol_authorize"); $message .= "
" . get_string("avsresult", "enrol_authorize", $stravs); @@ -391,8 +391,8 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ $ccaccepts = enrolment_plugin_authorize::get_list_of_creditcards(); unset($ccaccepts[$cctype]); set_config('an_acceptccs', implode(',', array_keys($ccaccepts))); - enrolment_plugin_authorize::email_to_admin("Autoconfigure; This card type " . - "isn't accepted: $cctype. New config:", $ccaccepts); + enrolment_plugin_authorize::email_to_admin("$message ($cctype)" . + "This is new config(an_acceptccs):", $ccaccepts); } break; } @@ -400,8 +400,8 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $ case AN_REASON_NOACH: { set_config('an_acceptmethods', AN_METHOD_CC); - enrolment_plugin_authorize::email_to_admin("Autoconfigure; ACH (Echeck) payment type " . - "isn't accepted: New config:", array(AN_METHOD_CC)); + enrolment_plugin_authorize::email_to_admin("$message " . + "This is new config(an_acceptmethods):", array(AN_METHOD_CC)); break; } // This echeck type isn't accepted -- 2.39.5