diff --git a/enrol/authorize/enrol.html b/enrol/authorize/enrol.html
index 71886dd862f..42e45af81c0 100755
--- a/enrol/authorize/enrol.html
+++ b/enrol/authorize/enrol.html
@@ -135,7 +135,7 @@ function print_cc_form($classreference)
authorizeerrors['cczip'])) { formerr($classreference->authorizeerrors['cczip']); } ?>
- ">
+ ">
@@ -206,7 +206,7 @@ function print_echeck_form($classreference)
authorizeerrors['firstlast'])) { formerr($classreference->authorizeerrors['firstlast']); } ?>
- ">
+ ">
diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php
index 1cec1b9fb94..c96e4e840b8 100755
--- a/enrol/authorize/enrol.php
+++ b/enrol/authorize/enrol.php
@@ -132,7 +132,7 @@ class enrolment_plugin_authorize
{
global $CFG;
- if (zero_cost($course) or
+ if (zero_cost($course) ||
(!empty($course->password) and !empty($form->password))) { // MANUAL ENROLMENT
$manual = enrolment_factory::factory('manual');
$manual->check_entry($form, $course);
@@ -141,21 +141,17 @@ class enrolment_plugin_authorize
}
}
else { // AUTHORIZE.NET ENROLMENT
- $paymentmethodsenabled = get_list_of_payment_methods();
- if (in_array(AN_METHOD_CC, $paymentmethodsenabled) and
- !empty($form->ccsubmit) and
- validate_cc_form($form, $this->authorizeerrors)) {
+ if (in_array($form->paymentmethod, get_list_of_payment_methods())) {
+ if ($form->paymentmethod == AN_METHOD_CC && validate_cc_form($form, $this->authorizeerrors)) {
$this->cc_submit($form, $course);
- }
- elseif (in_array(AN_METHOD_ECHECK, $paymentmethodsenabled) and
- !empty($form->echecksubmit) and
- validate_echeck_form($form, $this->authorizeerrors)) {
+ }
+ elseif($form->paymentmethod == AN_METHOD_ECHECK && validate_echeck_form($form, $this->authorizeerrors)) {
$this->echeck_submit($form, $course);
+ }
}
}
}
-
/**
* Credit card number mode.
* Send to authorize.net.