]> git.mjollnir.org Git - moodle.git/commitdiff
Submit buttons (ccsubmit, echecksubmit) are no longer used. Hidden field paymentmetho...
authorethem <ethem>
Sat, 2 Sep 2006 13:09:21 +0000 (13:09 +0000)
committerethem <ethem>
Sat, 2 Sep 2006 13:09:21 +0000 (13:09 +0000)
enrol/authorize/enrol.html
enrol/authorize/enrol.php

index 71886dd862f3d9da49f2cb000c7358bd3bc88fec..42e45af81c0b3f81b67ff898586e07c4ecd21a7e 100755 (executable)
@@ -135,7 +135,7 @@ function print_cc_form($classreference)
       <?php if (!empty($classreference->authorizeerrors['cczip'])) { formerr($classreference->authorizeerrors['cczip']); } ?></td>
     </tr>
     </table>
-    <input type="submit" name="ccsubmit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
+    <input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
     </form>
     </div>
 <!-- END CC -->
@@ -206,7 +206,7 @@ function print_echeck_form($classreference)
       <?php if (!empty($classreference->authorizeerrors['firstlast'])) { formerr($classreference->authorizeerrors['firstlast']); } ?></td>
     </tr>
     </table>
-    <input type="submit" name="echecksubmit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
+    <input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_authorize") ?>">
     </form>
     </div>
 <!-- END ECHECK -->
index 1cec1b9fb9498d7f73beb2712c88b3cab60b0ba4..c96e4e840b8e0dc0a75a93b4941e89abd3637687 100755 (executable)
@@ -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.