Booking Form

Generally, bookable products require some information about the user and or the individuals attending. Once the user has selected all the passes they are interested in, you must fetch a BookingForm and provide an interface for the user to complete this form.

Note that the Passes in the arguments is a flattened array of Passes. For example if the user requires two of a single pass (i.e. two adult passes) then the array holds two of the same Pass type.

Traveler.fetchBookingForm(product: catalogItemDetails,
                           passes: selectedPasses) { (form, error) in

}

Alternatively you can use the delegate pattern

Traveler.fetchBookingForm(product: catalogItemDetails,
                           passes: selectedPasses,
                         delegate: self)
extension MyViewController: BookingFormFetchDelegate {
    func bookingFormFetchDidFailWith(_ error: Error) {
    
    }
    
    func bookingFormFetchDidSucceedWith(_ bookingForm: BookingForm) {
    
    }
}

Last updated