public function cancelAction() { $id = $this->_request->getFiltered('id'); $invoice = $this->getDi()->invoiceTable->findBySecureId($id, 'STOP' . $this->plugin->getId()); if (!$invoice) { throw new Am_Exception_InputError("No invoice found [{$invoiceId}]"); } if ($invoice->user_id != $this->getDi()->auth->getUserId()) { throw new Am_Exception_InternalError("User tried to access foreign invoice: [{$id}]"); } $invoice->setCancelled(); $this->_redirect('member/payment-history'); }