original_string: public function cancelPurchase( DirectDebit\Purchase $purchase )
      {
          $purchase->setRequiredFields(array('id','status'));
          $purchase->checkRequiredFields();
  
          $request = new Request(array(
              'method' => Request::PUT,
              'uri' => $this->prepareURI($this->purchasePath . $this->uriseparator . $purchase->id),
              'body' => $purchase
          ));
  
          $response = $this->client->processRequest($request);
          return new DirectDebit\Purchase($response);
      }
code: public function cancelPurchase( DirectDebit\Purchase $purchase )
      {
          $purchase->setRequiredFields(array('id','status'));
          $purchase->checkRequiredFields();
  
          $request = new Request(array(
              'method' => Request::PUT,
              'uri' => $this->prepareURI($this->purchasePath . $this->uriseparator . $purchase->id),
              'body' => $purchase
          ));
  
          $response = $this->client->processRequest($request);
          return new DirectDebit\Purchase($response);
      }
code_tokens: public function cancelPurchase ( DirectDebit \ Purchase $ purchase ) { $ purchase -> setRequiredFields ( array ( 'id' , 'status' ) ) ; $ purchase -> checkRequiredFields ( ) ; $ request = new Request ( array ( 'method' => Request :: PUT , 'uri' => $ this -> prepareURI ( $ this -> purchasePath . $ this -> uriseparator . $ purchase -> id ) , 'body' => $ purchase ) ) ; $ response = $ this -> client -> processRequest ( $ request ) ; return new DirectDebit \ Purchase ( $ response ) ; }
docstring: Cancel Purchase.
  
  @param \Paysafe\DirectDebit\Purchase $purchase
  @return \Paysafe\DirectDebit\Purchase
  @throws PaysafeException
docstring_tokens: Cancel Purchase .