public function decodeRequest($encryptedRequest)
 {
     if (empty($this->encryptionKey)) {
         throw new \Exception('encryption key not present.');
     }
     $encrypter = new \Encryption\Encrypter($this->encryptionKey);
     $serialized_request = $encrypter->decode($encryptedRequest);
     $request = json_decode($serialized_request, true);
     return $request;
 }
 public function decodeResponse($encoded)
 {
     $encrypter = new \Encryption\Encrypter($this->encryptionKey);
     $decoded = json_decode($encrypter->decode($encoded), true);
     return $decoded;
 }