src/Forms/OrderActionsForm.php
public function docancel($data, $form)
    {
        if (self::config()->allow_cancelling
            && $this->order->canCancel()
        ) {
            $this->order->Status = 'MemberCancelled';
            $this->order->write();

            if (self::config()->email_notification) {
                OrderEmailNotifier::create($this->order)->sendCancelNotification();
            }

            $this->controller->sessionMessage(
                _t(__CLASS__ . '.OrderCancelled', 'Order sucessfully cancelled'),
                'warning'
            );
            if (Security::getCurrentUser() && $link = $this->order->Link()) {
                $this->controller->redirect($link);
            } else {
                $this->controller->redirectBack();
            }
        }
    }
public function docancel($data, $form)
    {
        if (self::config()->allow_cancelling
            && $this->order->canCancel()
        ) {
            $this->order->Status = 'MemberCancelled';
            $this->order->write();

            if (self::config()->email_notification) {
                OrderEmailNotifier::create($this->order)->sendCancelNotification();
            }

            $this->controller->sessionMessage(
                _t(__CLASS__ . '.OrderCancelled', 'Order sucessfully cancelled'),
                'warning'
            );
            if (Security::getCurrentUser() && $link = $this->order->Link()) {
                $this->controller->redirect($link);
            } else {
                $this->controller->redirectBack();
            }
        }
    }
Form action handler for CancelOrderForm.

Take the order that this was to be change on,
and set the status that was requested from
the form request data.

@param  array $data The form request data submitted
@param  Form  $form The {@link Form} this was submitted on
@throws \SilverStripe\ORM\ValidationException