/** * @param ServiceRequest $request * @param string $reference * @param string $language * @throws ServiceHotelBookingException */ public function __construct(ServiceRequest $request, $reference, $language = "ENG") { try { $this->request_data = ["cancellationFlag" => "CANCELLATION"]; $this->response = $request->setOptions("bookings")->setOptions($reference)->setQueryStringParams($this->request_data)->send("DELETE"); } catch (\Exception $e) { $request_data = json_encode($this->request_data, true); throw new ServiceHotelCancellationException($request->getRequestUrl() . " - " . $e->getMessage() . " - " . $request_data); } }