/**
  * Send data to PayPal servers and handling the PayPal method "CancelPreapproval".
  *
  * <code>
  * $url  = "https://svcs.sandbox.paypal.com/AdaptivePayments";
  *
  * $options = new Registry();
  * $options->set("credentials.username", "itprism");
  * ....
  *
  * $paypal = new PrismPayPalAdaptive($url, $options);
  * $paypal->doVoid();
  * </code>
  *
  * @return Response
  *
  * @throws \RuntimeException
  */
 public function doVoid()
 {
     $url = $this->url . "CancelPreapproval";
     $data = array("preapprovalKey" => $this->options->get("payment.preapproval_key"), "requestEnvelope" => $this->options->get("request.envelope"));
     // Encode data to JSON.
     $jsonData = json_encode($data);
     // Prepare headers.
     $headers = $this->getHeaders($jsonData);
     // Make a request.
     $response = $this->transport->post($url, $jsonData, $headers);
     $response = $this->parseResponse($response, "json");
     $response = new Response($response);
     if ($response->isFailure()) {
         // Failure
         $this->error = $response->getErrorMessage();
         $this->errorCode = $response->getErrorCode();
         throw new \RuntimeException($this->error, $this->errorCode);
     }
     return $response;
 }