From 5b7e05d6460564ecbfc0a6afb511f04204d8c042 Mon Sep 17 00:00:00 2001 From: ethem Date: Sat, 2 Sep 2006 13:09:21 +0000 Subject: [PATCH] Submit buttons (ccsubmit, echecksubmit) are no longer used. Hidden field paymentmethod is enough for checking forms. --- enrol/authorize/enrol.html | 4 ++-- enrol/authorize/enrol.php | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/enrol/authorize/enrol.html b/enrol/authorize/enrol.html index 71886dd862..42e45af81c 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 1cec1b9fb9..c96e4e840b 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. -- 2.39.5