channel->request(MessageType::CustomerData, [ 'art' => 'Vorgänge', 'email' => $email, 'passwort' => $password, ]); } /** * @throws ApiClientException */ public function getBooking(string $email, string $password, int $id): Notification|Booking { return $this->channel->request(MessageType::CustomerData, [ 'art' => 'Vorgang_Details', 'email' => $email, 'passwort' => $password, 'idbuchung' => $id, ]); } /** * @throws ApiClientException */ public function getDocuments(string $email, string $password, int $bookingId, string $type): mixed { return $this->channel->request(MessageType::CustomerData, [ 'art' => $type, 'email' => $email, 'passwort' => $password, 'idbuchung' => $bookingId, ]); } /** * @throws ApiClientException */ public function updateBooking(BookingDto $formData, bool $debug = false): Notification|BookingUpdate { return $this->channel->request(MessageType::BookingUpdate, [ 'buchungsart' => Constants::BOOKING_TYPE_BOOKING, ...$this->bookingDataProcessor->createUpdateRequestPayload($formData), ], [], $debug); } /** * First phase of the two-phase booking process: validates the booking and returns the * prices without creating it. * * @throws ApiClientException */ public function createBookingInquiry(BookingDto $bookingDto, bool $debug = false): Notification|BookingResponse { return $this->sendBooking($bookingDto, Constants::BOOKING_TYPE_INQUIRY, $debug); } /** * Second phase of the two-phase booking process: creates the booking after a successful * inquiry. * * @throws ApiClientException */ public function createBooking(BookingDto $bookingDto, bool $debug = false): Notification|BookingResponse { return $this->sendBooking($bookingDto, Constants::BOOKING_TYPE_BOOKING, $debug); } /** * @throws ApiClientException */ private function sendBooking(BookingDto $bookingDto, string $bookingType, bool $debug): Notification|BookingResponse { return $this->channel->request(MessageType::Booking, $this->bookingDataProcessor->createBookingRequestPayload($bookingDto, $bookingType), [], $debug); } }