<?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 -->
<?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 -->
{
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);
}
}
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.