docs/platform/guides/custom-booking-flow.mdx
If you want to have a custom payment flow or any other custom action before the booking happens, you can intercept the booking once the user clicks book in the Booker atom, run whatever custom code you need and then finally submit the booking with the intercepted booking data.
In your component that renders the Booker atom create a interceptBooking function that will be passed to the Booker atom handleCreateBooking hook. See Booker atom docs on how to use it - in this tutorial
we focus on the handleCreateBooking hook.
import { Booker, UseCreateBookingInput } from "@calcom/atoms";
export function BookingPage(props: { calUsername: string; calEmail: string }) {
...
const interceptBooking = useCallback((data: UseCreateBookingInput) => {
console.log(data);
}, []);
return (
<Booker
handleCreateBooking={interceptBooking}
...
/>
);
}
interceptBooking function will be called and will receive all the booking data.interceptBooking and make a POST request to
create booking endpoint to actually create the booking.