Submit buttons (ccsubmit, echecksubmit) are no longer used. Hidden field paymentmethod is enough for checking forms.
This commit is contained in:
@@ -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 -->
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user