/**
  * @param int         $id
  * @param string|null $reason
  * @return bool
  */
 public function cancel($id, $reason = null)
 {
     $data = new OrderUnitCancelTransfer();
     if (null !== $reason) {
         $data->reason = $reason;
     }
     $endpoint = new Cancel($this->getTransport());
     $endpoint->setId($id);
     $endpoint->setTransfer($data);
     try {
         $result = $endpoint->performRequest();
     } catch (ResourceNotFoundException $e) {
         return false;
     }
     return $result['status'] == 204;
 }