Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Don't show AVS message if not applicable.

+ Email message that translated instead of english if cc will be autoconfigured.
  • Loading branch information...
commit 19660487d0cf24b535fae0610dafe951be0df32d 1 parent 5ab3937
ethem authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 enrol/authorize/authorizenetlib.php
16 enrol/authorize/authorizenetlib.php
View
@@ -338,18 +338,18 @@ function authorize_action(&$order, &$message, &$extra, $action=AN_ACTION_NONE, $
if ($message == '[[' . $reasonstr . ']]') {
$message = isset($response[3]) ? $response[3] : 'unknown error';
}
- if (!$test && !empty($cctype) && ($reasonno == 17 or $reasonno == 28)) {
- $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);
- }
- if (!empty($CFG->an_avs)) {
+ if (! (empty($CFG->an_avs) or $response[5] == "P")) { // P = AVS not applicable
$avs = "avs" . strtolower($response[5]);
$stravs = get_string($avs, "enrol_authorize");
$message .= "<br />" . get_string("avsresult", "enrol_authorize", $stravs);
}
+ if (!$test && !empty($cctype) && ($reasonno == 17 or $reasonno == 28)) {
+ $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("$message: ($cctype)" .
+ "This is new config(an_acceptccs):", $ccaccepts);
+ }
return false;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.