Where does the transactionReference come from? If it's sent in a post request, you should fetch it automatically using

    $this->httpRequest->request->get('parametername');

Instead of making the user do this.