original_string: public function cancelSettlement(CardPayments\Settlement $settlement)
      {
          $settlement->setRequiredFields(array('id'));
          $settlement->checkRequiredFields();
  
          $tmpSettlement = new CardPayments\Settlement(array(
               'status' => 'CANCELLED'
          ));
          $request = new Request(array(
               'method' => Request::PUT,
               'uri' => $this->prepareURI("/settlements/" . $settlement->id),
               'body' => $tmpSettlement
          ));
          $response = $this->client->processRequest($request);
  
          return new CardPayments\Settlement($response);
      }
code: public function cancelSettlement(CardPayments\Settlement $settlement)
      {
          $settlement->setRequiredFields(array('id'));
          $settlement->checkRequiredFields();
  
          $tmpSettlement = new CardPayments\Settlement(array(
               'status' => 'CANCELLED'
          ));
          $request = new Request(array(
               'method' => Request::PUT,
               'uri' => $this->prepareURI("/settlements/" . $settlement->id),
               'body' => $tmpSettlement
          ));
          $response = $this->client->processRequest($request);
  
          return new CardPayments\Settlement($response);
      }
code_tokens: public function cancelSettlement ( CardPayments \ Settlement $ settlement ) { $ settlement -> setRequiredFields ( array ( 'id' ) ) ; $ settlement -> checkRequiredFields ( ) ; $ tmpSettlement = new CardPayments \ Settlement ( array ( 'status' => 'CANCELLED' ) ) ; $ request = new Request ( array ( 'method' => Request :: PUT , 'uri' => $ this -> prepareURI ( "/settlements/" . $ settlement -> id ) , 'body' => $ tmpSettlement ) ) ; $ response = $ this -> client -> processRequest ( $ request ) ; return new CardPayments \ Settlement ( $ response ) ; }
docstring: Cancel settlement.
  
  @param \Paysafe\CardPayments\Settlement $settlement
  @return \Paysafe\CardPayments\Settlement
  @throws PaysafeException
docstring_tokens: Cancel settlement .