if (!empty($cmdcapture)) { // CAPTURE
if (!in_array(ORDER_CAPTURE, $status->actions)) {
- error("You can't do this action:" + ORDER_CAPTURE);
+ $a->action = ORDER_CAPTURE;
+ error(get_string('youcantdo', 'enrol_authorize', $a));
}
if (empty($cmdconfirm)) {
}
elseif (!empty($cmdrefund)) { // REFUND
if (!in_array(ORDER_REFUND, $status->actions)) {
- error("You can't do this action:" + ORDER_REFUND);
+ $a->action = ORDER_REFUND;
+ error(get_string('youcantdo', 'enrol_authorize', $a));
}
$extra = new stdClass();
}
elseif (!empty($cmdvoid)) { // VOID
if (!in_array(ORDER_VOID, $status->actions)) {
- error("You can't do this action:" + ORDER_VOID);
+ $a->action = ORDER_VOID;
+ error(get_string('youcantdo', 'enrol_authorize', $a));
}
$suborderno = optional_param('suborder', 0, PARAM_INT);
}
elseif (!empty($cmddelete)) { // DELETE
if (!in_array(ORDER_DELETE, $status->actions)) {
- error("You can't do this action:" + ORDER_DELETE);
+ $a->action = ORDER_DELETE;
+ error(get_string('youcantdo', 'enrol_authorize', $a));
}
//if (!in_array(ORDER_DELETE, $status->actions)) {
// error("Order $orderno cannot be deleted. Status must be expired.");
global $CFG, $USER;
$ret = new stdClass();
+ $ret->actions = array();
if (intval($order->transid) == 0) { // test transaction
if (isadmin() || (!empty($CFG->an_teachermanagepay) && isteacher($order->courseid))) {