/**
  * delete transaction
  * @param $id
  * @param $transactionId
  * @return mixed
  */
 public function destroy($id, $transactionId)
 {
     $activity = $this->activityManager->getActivityData($id);
     if (Gate::denies('ownership', $activity)) {
         return redirect()->back()->withResponse($this->getNoPrivilegesMessage());
     }
     if (!$this->currentUserIsAuthorizedForTransaction($transactionId)) {
         return redirect()->back()->withResponse($this->getNoPrivilegesMessage());
     }
     $this->authorize('delete_activity', $activity);
     $transaction = $this->transactionManager->getTransaction($transactionId);
     if ($this->transactionManager->deleteTransaction($transaction)) {
         $this->activityManager->resetActivityWorkflow($id);
         $response = ['type' => 'success', 'code' => ['deleted', ['name' => 'Transaction']]];
     } else {
         $response = ['type' => 'danger', 'code' => ['delete_failed', ['name' => 'transaction']]];
     }
     return redirect()->back()->withResponse($response);
 }